use iterator is better