Initial Pattern Recognizer code