Make finding max of list more efficient