Combined update loops into one loop.