Instead of keeping an index around you can use `.enumerate()` on the iterator.