added flatten_dict func