Good idea, to save time you could loop only 5 seconds around the boundary instead of the whole sample.
Yes that’s the idea :)