added detectPeaks function to command line script