add gradients to intermed estimates