https://medium.com/@baggagebee.....guide/calculating-p