finalizing the output format