finish pattern recognition