adding gradient to scale and update doc