Improved pattern-match code and explanation.

This cleans up a warning about an unused variable and explains the code
further.