Using max_element to find peak