Fix update loop

This gameloop should work correctly I think.