Some fixes to get the snippet code working.
Added an explanation.