reformat the document