added pattern matching code examples