code now runs, does not iterate