take into account that unsigned iterators may wrap