nlm -> nls
Fixed error in formula, now outputs graph.
Put NLS in a function