changed loop index