Adding code and related files for SGD