add reg for state/next + more states