working on the gradient descent formula