Unfinished changes, print tree bug fixed