Add pattern matching.