Started rewriting the State class.