added gradient descent for least squares