updates preping for sgd