I suggest you post your code in a code block, so we can copy it into Mathematica. You can find out how to do that here: How to post
Anyone there to help?
You never included cut-and-pastable code: the tangle above has syntax problems. If you put it in a notebook (not a pdf file) and attach that, then maybe somebody will try it out.