Rearranged update loop by global loop