how to create patterns