remove duplicates from previous rearrange