Update tree.cpp