reorder patterns