added back iteration logic