[#13] using max_by instead of sort_by