Implement Naive pattern matching