make a sgd version of the code!