Duplicates-aware IW(1)

* Algorithm has been tested and last warts removed