Added functions to game class and fixed bugs