squash function

Squash overlapping intervals into non-overlapping spans