add tree, some fixes