going the iterative way