Reformat Output logic