implemented interval comparisons