This is a working version with a functional, if rudimentary, logging system.