First version of source files and UnionFind class