added narrow build compatible patterns, and match function