preparing the pattern