Update tree.py