mad pattern-matching skills