docs: def add_data(self):
          """This function properly constructs a QR code's data string. It takes
          into account the interleaving pattern required by the standard.
          """
          #Encode the data into a QR code
          self.buffer.write(self.binary_string(self.mode, 4))
          self.buffer.write(self.get_data_length())
          self.buffer.write(self.encode())
  
          #Converts the buffer into "code word" integers.
          #The online debugger outputs them this way, makes
          #for easier comparisons.
          #s = self.buffer.getvalue()
          #for i in range(0, len(s), 8):
          #    print(int(s[i:i+8], 2), end=',')
          #print()
          
          #Fix for issue #3: https://github.com/mnooner256/pyqrcode/issues/3#
          #I was performing the terminate_bits() part in the encoding.
          #As per the standard, terminating bits are only supposed to
          #be added after the bit stream is complete. I took that to
          #mean after the encoding, but actually it is after the entire
          #bit stream has been constructed.
          bits = self.terminate_bits(self.buffer.getvalue())
          if bits is not None:
              self.buffer.write(bits)
  
          #delimit_words and add_words can return None
          add_bits = self.delimit_words()
          if add_bits:
              self.buffer.write(add_bits)
          
          fill_bytes = self.add_words()
          if fill_bytes:
              self.buffer.write(fill_bytes)
          
          #Get a numeric representation of the data
          data = [int(''.join(x),2)
                      for x in self.grouper(8, self.buffer.getvalue())]
  
          #This is the error information for the code
          error_info = tables.eccwbi[self.version][self.error]
  
          #This will hold our data blocks
          data_blocks = []
  
          #This will hold our error blocks
          error_blocks = []
  
          #Some codes have the data sliced into two different sized blocks
          #for example, first two 14 word sized blocks, then four 15 word
          #sized blocks. This means that slicing size can change over time.
          data_block_sizes = [error_info[2]] * error_info[1]
          if error_info[3] != 0:
              data_block_sizes.extend([error_info[4]] * error_info[3])
  
          #For every block of data, slice the data into the appropriate
          #sized block
          current_byte = 0
          for n_data_blocks in data_block_sizes:
              data_blocks.append(data[current_byte:current_byte+n_data_blocks])
              current_byte += n_data_blocks
          
          #I am not sure about the test after the "and". This was added to
          #fix a bug where after delimit_words padded the bit stream, a zero
          #byte ends up being added. After checking around, it seems this extra
          #byte is supposed to be chopped off, but I cannot find that in the
          #standard! I am adding it to solve the bug, I believe it is correct.
          if current_byte < len(data):
              raise ValueError('Too much data for this code version.')
  
          #DEBUG CODE!!!!
          #Print out the data blocks
          #print('Data Blocks:\n{0}'.format(data_blocks))
  
          #Calculate the error blocks
          for n, block in enumerate(data_blocks):
              error_blocks.append(self.make_error_block(block, n))
  
          #DEBUG CODE!!!!
          #Print out the error blocks
          #print('Error Blocks:\n{0}'.format(error_blocks))
  
          #Buffer we will write our data blocks into
          data_buffer = io.StringIO()
  
          #Add the data blocks
          #Write the buffer such that: block 1 byte 1, block 2 byte 1, etc.
          largest_block = max(error_info[2], error_info[4])+error_info[0]
          for i in range(largest_block):
              for block in data_blocks:
                  if i < len(block):
                      data_buffer.write(self.binary_string(block[i], 8))
  
          #Add the error code blocks.
          #Write the buffer such that: block 1 byte 1, block 2 byte 2, etc.
          for i in range(error_info[0]):
              for block in error_blocks:
                  data_buffer.write(self.binary_string(block[i], 8))
  
          self.buffer = data_buffer