Depth first traversing trees