added misc/tree.cpp