need to remove duplicates and sort the results