working naive pattern matching proto