pass trees in for recursion purposes