gradient descent for one var works