modified GaussNewtonMethod.java