First implementation of quick union.