References, minor improvements to disjoint set