update for iterator design pattern