added iterator design pattern