a remove-duplicated algorithms