merge random SGD to the code