Lots of general improvements.  All checks pass with simulation.