updated game architecture, fixed a lot of bugs