Made print iteration number an optional input