add peak detection