iteration number now is an argument.