ADD: optimizations to quick union