more realistic UnionFind implementation
introduced callbacks in UFA mockup