getting a pointer to the root of the tree