Attempting to get the gradient vector. But I think something has gone wrong.