traversing trees tasks