This argument index is never read and I don't see how it would be useful. I think d should be a `set` or maybe `OrderedSet` if order does actually matter - does it?