Added basics of pattern matching into the system.