why do you use an explicit iterator here instead of using a for loop?