added iterator version

pushing to continue on laptop