def configfilepopulator(self):
        self.forwardlength = self.metadata.header.forwardlength
        self.reverselength = self.metadata.header.reverselength
        cycles = [[1, self.forwardlength, self.runid],
                  [self.forwardlength + 1, self.forwardlength + 8, self.runid],
                  [self.forwardlength + 9, self.forwardlength + 16, self.runid],
                  [self.forwardlength + 17, self.forwardlength + 16 + self.reverselength, self.runid]]
        parameters = {'RunFolder': self.runid, 'RunFolderDate': self.metadata.date.replace("-", ""),
                      'RunFolderId': self.metadata.runnumber, 'RunFlowcellId': self.metadata.flowcell}
        config = ElementTree.parse("{}/config.xml".format(self.homepath))
        configroot = config.getroot()
        for run in configroot:
            for child in run:
                if child.tag == 'Cycles':
                    child.attrib = {'Last': '{}'.format(self.forwardlength + 16 + self.reverselength),
                                    'Number': '{}'.format(self.totalreads), 'First': '1'}
                elif child.tag == 'RunParameters':
                    runparameters = child
                    for runparameter in runparameters:
                        if 'Reads' in runparameter.tag:
                            for indexcount, reads in enumerate(runparameter):
                                index = int(runparameter.attrib['Index']) - 1
                                reads.text = str(cycles[index][indexcount])
                        if runparameter.tag == 'Instrument':
                            runparameter.text = self.instrument
                        for parameter in parameters:
                            if runparameter.tag == parameter:
                                runparameter.text = parameters[parameter]
                        if 'Barcode' in runparameter.tag:
                            for cycle, barcode in enumerate(runparameter):
                                barcode.text = str(self.forwardlength + 1 + cycle)
        config.write('{}Data/Intensities/BaseCalls/config.xml'.format(self.miseqfolder))