updated mtree.c