functions on dictionaries