sgd
code cleanup