strategy 2 using iterators
strategy 2 using iterators