implemented dynamic iterator