add tree edge functionality