https://pyramid.pythonprogramminghelp.com/confessions-of-a-mathematical-methods/