with gradients working