Code to do the fitting.

Fitting code and a basic how-to file.