I don't like the shadowing of "match" here--I chose a different name for the outer variable for this reason.