fixed iterating with indexes, again