latest code as at 12/1/13