added UnionFind, update to vj.py