Modified algorithm on DOC