implement a simulator.