Initial commit of functions from github.com/btracey/optimize

Yes. Fixed blank line issue and improved comment slightly.