made end_id inclusive