modified mergeReads to accept a parameter for the output file