code: def replace_read(self):
          
          for statenum in self.statediag:
              state = self.statediag[statenum]
              if state.type == 3:  # READ state
                  state.type = 1
                  destination_and_symbol = self._generate_state(state.trans)
                  state.sym = destination_and_symbol
                  state.trans = {}
                  state.trans[destination_and_symbol] = [0]
          statenumber_identifier = len(self.statediag) + 1
          for state in self.toadd:
              self.statediag[statenumber_identifier] = state
              statenumber_identifier = statenumber_identifier + 1
          return self.statediag
docs: Replaces all READ (type - 3) states to a PUSH (type - 1) and a POP (type - 2).
          The actual state is replaced with the PUSH, and a new POP is created.