set right pointer for tree
changed tree node class function class