updated to work with -D no-pattern-matching