I think this page explains what Walter is doing pretty well ...
http://www.batsocks.co.uk/readme/p_tut_led16.htm