refactored gradient descent for more modularity
Renamed Ring to Scalar