account for multiple peaks in peak detection