Added a line to printTree method. Checks if the rootParent has been set