Can you please replace this loop with a call to `std::max_element()`