added peakflagging procedure