The block of code below. But it turns out that I'm going to be changing this tree to arrays stuff anyway, so this question is no longer relavant.