changed loop num