added pattern matching example