Added in test code for selecting patterns