add find connection trees function