Remove duplicates and sort list