pattern recognition init