added pattern matching fns