Remove sorting and just implement Max