added loop to skip spectra which don't have some peaks at all