Cleaned up Newton's method, secant method.