Beginner code to create patterns