Gotcha. That’s precisely the approach I tried first, but the code I wrote to do those tree manipulations grew so convoluted and prone to errors that I eventually scrapped it, assuming that the overall strategy was flawed.
Perhaps I’ll give it another go…