added method and implementation for setting the number of players