plain_sgd now accepts string argument