added function "randomDuplicates"