Newton method nearly basicly completed with some bugs