https://jython.pythonprogramminghelp.com/getting-smart-with-newtons-method/