Initial idea for setting up iteration function