implemented fitting and extinction
added documentation for fitting