Cut down on the allocation when removing elements.  Instead of returning a pair from various functions, we pass down a reference and populate it.  There is now only 1 uniq object instead of one per recursive call.  About 8% speedup.