implemented Newton's solver