Docman main code