Added code.  Time for bed; I'll test it tomorrow