The code would be a bit easier to follow if these were something like `oldTreeIndex` and `newTreeIndex` instead of `i` and `j`. (Or something a little shorter, like `oldi` and `newi`? Basically, something that just makes it clearer which tree it's an index into.)