added a new code for peak finding