change registers and divide states