moved PatternRec