adding methods to count nodes and getHeight of the tree.