Thanks Paul, really appreciate you breaking down the operation of the code.
PaulRB:
An important thing to understand is that when you set a pin to OUTPUT, it either defaults to LOW, or whatever it was set to last time is was set to OUTPUT.
That I didn't know, now it makes sense why LED 3 is illuminating.