partway through tree implementation