modified binary tree into a map structure
finished collision detection using disjoint set to perform merge