upgrade to newer code version
move UnionFind structure outside
Merge pull request #23 from escherba/dev

newer code version