finish the output function