sorts the team index