Added functions for manage the game