added iterator instead of pop mech