continuing work on demultiplex script