It's too large to attach but here is a link:

https://drive.google.com/file/d/1D8S...ew?usp=sharing



The second module (at the end) contains the section of code in question.