added sorting for Intervals