first traversal version