minor edits to likelihood_sgd function