use an iterator over ruptures to save memory