adding changes to the sgd.py