function to remove duplicates and remove duplicates in allStar