solve the insert interval problem.