Building the tree is complete! adding h and hprime functions