implemented remove dupes (untested)