insert interval better solution