changed loop count