adding iterative snippet