Functioning game loop