Fixing the gradient