added comments to tree.cpp