SGD code completed; getAccuracy function added