Fix sorted_students and create students_for_team.