Added function to count the number of nodes in the tree