Working simulator.  Need to debug it, though.