added option to bin spectra