working on the newton's method for the system