major rework of game engine and some cleanup