Add previous step to iteration function.