Adding function to generate data without duplicates.