added gamestate and fixed compile errors