added first version of stochastic gradient descent