replace tree.sh with a better version