implement impr using Set instead of list