Implement doc-delete function.