moved findPeak to Graph class