FYI, the code you've given simply doesn't work. If you actually have some working code, then run it to check that it works and copy and paste the full code please.
That's simple. What do you have so far?Anyway, let's focus on the other problem now.