put fastq dumping into a function