lots of logging to aid in debug.  Many small changes as bugs are found