wrote pseudocode for player change team event