sgd update working, but slow