add get_peaks function