Finished game engine logic