calculated gradients