finished output function