Removed loops while plotting spectral peaks