combining reachingMerge and reachingMatches nets slightly better performance and simplifies the traversal algorithm.