spectra fitting working