Adding SGD and arranging things