+<!--
+A tree with n leaves has 2n - 1 nodes.
+This function will currently return n*1 + (n-1)*2 = 3n - 2.
+To convert b = 3n - 2 into 2n - 1, we can use: let n = (b + 2)/3 in 2*n -1
+
+But I assume Chris means here, adjust the code so that no corrections of this sort have to be applied.
+-->
+
+