Adding indexed looping