this saves me a LOT of time on large adjacency list trees