Added minimizer working with hessian and jac but still getting NaN here and there