Switch to DenseSet, simplifying much more code. We now have a single iteration