Added reset condition to peak finder

Attempting to initialize the number of peaks and troughs to 0