make that `segments.shift` rather than `segments.delete(segment)` because you always want to remove the first one, right?