Added method for flattenning dicts.