added control and game loop