fixing ranges and iterators