polished up run_sgd.py