solution to Insert Interval