add document and random (not tested)