sorting for teams

turns off if no teams are present