updated prunetree.py