minimized length of used pattern to 4 => x p1 p2 y