added a slightly different way on iteration