use const_iterators wherever possible