Improved update loop.