Thanks for your response, however I couldn't get this to work.
When calculating the size of the repeat, I get an error using the function "size". Has "size" function been replaced? I can use "sum" without errors, however, I cannot preview in a browser. Something still not right.
Modified form... https://drive.google.com/file/d/1s0C1vsNIF4fAhDjK24GEBl95Q2qXlNbe/view?usp=sharing