improved setIterator method