merge overlapping intervals