the use of history in gen~ for beginner part4
hello guys,I'm trying to learn gen~ from the gen~ for beginner tutorial,I've got a question about the last patch in Part 4:

what I get from this patch is(seems wrong from the result I heard):
the main purpose of this patch is to create a writable buffer and mix this buffer signal to the orginal signal
the size of this buffer is controled by delayamt,each time this value changes the patch will rewrite the buffer
poke here is to do the writing job,since it receives a changing value(let's say 1 to 3000),it will write a buffer from 1st to 3000 samples,like “recording the 3000 samples” from the time the switch turns on,and each time it reach 3000 it will resample another buffer from the original signal
peek here is to do the loading job,from 1 to 3000,and mix this signal to the original one
regen is like Feedback,controls the writable buffer repeat time,wet/dry is the w/d mix
my question is,what is this history do in this patch?from what i can find this history is a 1 sample delay,means Everything goes into it gets a 1 sample delay,for this patch it's the counter output which will goes into poke through history,means the writable buffer is one sample delayed as to the Original one when mixed together
but one sample is barely no time,why cant we just skip this history and directly use output of count as poke input?Is this some kind of protection to make sure there is a sample value to write to the buffer,then let poke write it because gen is processing data by sample so it cant play(Original),write(to buffer),mix and output(to mix object and output)at the same time?
another question is how did delayamt worked as “delaytime” in this patch?
hope I explained my question clear……
go go~ I will post more questions about this gen~ serials in the post,the new question is in part 5 codebox part:

I cant understand why wrap function is using threshold%diff,isnt warp is “a relationship between original signal and threshold?”