took out loops over dictionaries