completed gradientDescent