Adding state variables including reg update. Started on state logic. Adding content of FSM.