Fold in the gradient

Change-Id: Ifc74553823509f1c4978e9e38d13bbafb855eff8