Working with pattern matching