Also a Set could be used to detect duplicates.