Added a condition and the Reformat logic