remove duplicates from sorted list. only keep the distict elements.