Ported old beta teamswitcher rewrite