moved patternrec