debugging pattern matching