replaced static in tree_compare()