added peakDetection from KenniK