[new] merge ranges (no circle)
[add] handle the circular case