Implementing the doc extaction feature