Adding basic pattern matching