Actually, I don't think we need the ```if tnodes.length > 1``` and this ```else```: the main code should work fine in both cases.