Updated tests and added peakDetect