add a join() helper function to make treeToList more concise. further improvements will have to come from using an append method