Added hack the tree code