Added a state class, improved reaction class.