sprinkle unique_dict throughout code