Added tests and simulation.