training the pattern