figuring out gradients