Huh? We are showing you some PROPER 'code structures' so why don't you want to learn from them??? You are writing incorrect things that give you these errors and you ask for help solving them. Learn from what we give you, not some other method that you apparently do not know, hence the errors are arising.
One of the best people on this forum gave you a solution and you SNUBBED him. Really? A guy spends his time to help you and you just flat out told him you didn't want his help.