Make main function in tree.py