function for grep\'ing facts