Significant re-factoring.  Starting to add code for simulation