Implemented getPlayerNames function