in reply to What can I do to improve my code - I'm a beginner

Hi Anon Monk!
I encourage you to sign up for an account. An account is free and helps at least me understand who is posting what...

I found your code hard to follow. I present an alternative below and will offer a few comments.