replaced conflict calculation with efficient IntervalTree from Sedgewick
and Wayne