added simple pattern matcher