Modified some functions to work with dictionaries