completed optimized DAG collapse search for insertions