added some game engine code