ex3 update with iterator.