feature - function which sets the state to the ground state.
minor - small fixes related to this.