Added initial pattern matching