added pattern matching function, can't yet match against records though.