creating documentFormatting method