Finalize the output