Modify global variables' names. Rewrite readtree fuction.