Update gen_tree.php