added iterator pattern