add pattern matching for instruction processing