I have already explored the link and tested code examples and can offer my insight.
I can assist if you format your code and delete your duplicate post; please do this as a courtesy to others.
Try to cut and paste your code and you will see why this is an issue.
You can go back and edit it.