changing the inject iterators method