added some peak-searching code