added game loop and gui controller