add missing pattern (height->width) and make PATTERNS global