Revamping the tree. Its now written in an OO style rather than a functional style.