implement simple game loop