Lots of cleanup in fit_profile, wrote lots of documentation.