Added nextPlayer() function