trying to use lastIterator instead of index