hw2 pattern matching case types