Implementation of gradient descent added