Added pattern matching semantics