finish part of bitree.c