Boundary merging algorithm works and has been tested.