Added code for the game engine