changed loop to item rather than index style