Adding automatic pattern generation feature.