Implemented region merging based on Fisher's exact test.