first version of the game loop, not tested yet