Fiddled with the partial implementation of pattern matching.