Added feature to determine next player's turn