implement traversal at a given level