Preparing the pattern generator