adding support for patterns