transforming self outlinks into set removing doubloons