added in_dict function