Implement confusion process_doc