updated tree.h and tree.c