3.3 Practice: patterns and sorting