Implemented first version of states.