update patternMatching class