I think the first step here would be to paste your code in a way we can run in our machines. I realize this could be a bit more borhersome, but it will allow us to help you more quickly (and, we really want to since we’re a nice community! )
For example
your code should be inside this
Some other useful guidelines on how to post code, use discourse most efficiently etc. are also given here: