Aligning patterns