doc; only run when deep is provided;