sort intervals