diff --git a/biopet.wdl b/biopet.wdl
index cc3a9159694a9ac7edf8c8321f57c57d78fe395a..8dd6e7870511741d62281ad79ab0c1ec94ad4d3d 100644
--- a/biopet.wdl
+++ b/biopet.wdl
@@ -70,26 +70,25 @@ task BaseCounter {
 task FastqSplitter {
     String? preCommand
     File inputFastq
-    String outputPath
-    Int numberChunks
-    String tool_jar
-    Array[Int] chunks = range(numberChunks)
+    Array[String] outputPaths
+    String toolJar
 
     command {
         set -e -o pipefail
         ${preCommand}
-        mkdir -p ${sep=' ' prefix(outputPath + "/chunk_", chunks)}
-        if [ ${numberChunks} -gt 1 ]; then
-            SEP="/${basename(inputFastq)} -o "
-            java -jar ${tool_jar} -I ${inputFastq} -o ${sep='$SEP' prefix(outputPath + "/chunk_", chunks)}/${basename(inputFastq)}
-        else
-            ln -sf ${inputFastq} ${outputPath}/chunk_0/${basename(inputFastq)}
-        fi
+        for
+        mkdir -p $(dirname ${sep=') $(dirname ' outputPaths})
+        if [ ${length(outputPaths)} -gt 1 ]; then
+            java -jar ${toolJar} \
+            -I ${inputFastq} \
+            -o ${sep=' -o ' outputPaths}
+          else
+            ln -sf ${inputFastq} ${outputPaths[0]}
+          fi
     }
 
     output {
-        Array[File] chunkDirs = prefix(outputPath + "/chunk_", chunks)
-        String filename = basename(inputFastq)
+        Array[File] chunks = outputPaths
     }
 }