Modifying SGD and RNG to work online