Added pattern matching.