still, i don't see why you need to copy the vector and keep the original. `nodes[idx]` is anyway removed.