use gradients to compute lambda_G
fix comentary