added checks for zero peaks