What does your layer-source look like?
I copy the whole thing over and leave in all the stuff about pink/blue/green/red
I copy it over, then delete the helpful commented stuff, and then I get confused.
I learn what it does, then I copy it in, remove the comments, and add my own little commenting.
I learn what it does, then I copy it in, remove all the comments, add my own features, and my own commenting.
I haven't a clue how this stuff works, my source is quite messy.
I've organized everything nicely, so I know what functions are where and what they do.
If it doesn't compile the first time, i just go back to S1.