modify for iterative