FYI 2: Please be sure to do basic debugging in the future before posting threads. It is not proper use of this category to say that your code is not working and then dump your code in a thread and ask for fixes. Please review the category guidelines.
Always try fixing this yourself first, then you can post a thread with added detail. Don’t make a thread where you just say your code doesn’t work and then post everything on the thread.