Almost done with pattern matching