Changed hw1-8 (newton's method)