Implemented a method to swap players named swapPlayers.