Apparently the previous commit contained a bug.
It didn't actually work perfectly :(
The use of a no duplicates policy did however improve the algorithm
slightly.