Added patterns and pattern matching