Added support for SGD