Document the matching logic