added gradient descent