Made a few changes previously to extend the simulator. Untested.