trimmed the unique function