mostly sgd additions