Nearly finished refactored spectral fit program