Changed the state implementation