add a partition and  some tree traversal functions