Added peak finding function.