working through Newton's method