Modified code to accept and set player names