working nonlinear CG