Just in case anybody is confused, the polarity of the LED does matter, as above, but the resistor is the same whichever way round it is connected, and in whichever leg it is - so, just get the resistor somewhere in series with the LED, have the LED the right way round ( long leg is positive ) and all should be well.