New gradients implementation