I'm astonished that you actually expected good quality answers by just pasting your code without an ounce of detail specifying what your issue is.

For anyone willing to investigate further, here's...