revised single traversal def