refactor - SortHelper.
* checking merged regions insdie SortHelper.