Added some more pattern matching