I know I am being naive
Naivety we are fine with. Foremost this is a place of learning and naivety is to be expected. What makes us grumpy or inclined to ignore supplicants is when we offer advice that seems to be ignored. In this case you have had a number of replies that each address points 1 - 3. Go back and re-read them, and remember that what we tell you three times is true!
If you have specific questions about some code you have been offered ask them in a reply to the node the code was provided to. That makes it easier for people who come afterwards to follow the different threads of "conversation".
Oh, and if you simplify your problem to the point of irrelevance, the answers you get will be irrelevant too!
True laziness is hard work