fixing the nonlinear equation Jacobian calculation