added functions to correct spectra weighted by spectrum