Added some comments to game engine, and fixed some minor bugs