diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndexer.java b/src/main/java/de/ids_mannheim/korap/KorapIndexer.java
index 1bdfb8d..b935db8 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndexer.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndexer.java
@@ -12,25 +12,22 @@
     int count;
     int commitCount;
 
+    // Init logger
     private final static Logger log = LoggerFactory.getLogger(KorapIndexer.class);
 
-    public KorapIndexer () throws IOException {
+    public KorapIndexer(Properties prop) throws IOException {
+        this.indexDir = prop.getProperty("lucene.indexDir");
 
-        Properties prop = new Properties();
-
-	ClassLoader classLoader = getClass().getClassLoader();
-	InputStream fr = classLoader.getResourceAsStream("korap.conf");
-
-	prop.load(fr);
-
-	this.indexDir = prop.getProperty("lucene.index");
-	String commitCount = prop.getProperty("lucene.index.commit.count", "1000");
+	System.out.println("Index to " + this.indexDir);
+	
+        String commitCount = prop.getProperty("lucene.index.commit.count", "1000");
 
 	this.index = new KorapIndex(new MMapDirectory(new File(indexDir)));
-	this.count = 0;
-	this.commitCount = Integer.parseInt(commitCount);
+        this.count = 0;
+        this.commitCount = Integer.parseInt(commitCount);
     };
 
+    
     public void parse (File dir) {
 	for (String file : dir.list()) {
 	    if (file.matches("^[^\\.].+?\\.json\\.gz$")) {
@@ -49,6 +46,7 @@
 	};
     };
 
+
     public void commit () {
 	System.out.println("-----");
 	System.out.print("  Commit ... ");
@@ -61,25 +59,28 @@
 	System.out.println("done.");
     };
 
-    public static void main(String[] args) throws IOException {
 
-	KorapIndexer ki = new KorapIndexer();
 
+    public static void main (String[] argv) throws IOException {
+	Properties prop = new Properties();
+	InputStream fr = new FileInputStream(argv[0]);
+	prop.load(fr);
+	KorapIndexer ki = new KorapIndexer(prop);
 	System.out.println();
 
-	for (String arg : args) {
-	    File f = new File( arg );
-	    if (f.isDirectory()) {
-		ki.parse(f);
-	    };
-	};
+        for (String arg :  Arrays.copyOfRange(argv, 1, argv.length)) {
+            File f = new File(arg);
+            if (f.isDirectory())
+                ki.parse(f);
+        };
 
-	// Final commit
-	ki.commit();
 
-	// Finish indexing
-	System.out.println("-----");
-	System.out.println("  Indexed " + ki.count + " files.");
-	System.out.println();
+        // Final commit
+        ki.commit();
+
+        // Finish indexing
+        System.out.println("-----");
+        System.out.println("  Indexed " + ki.count + " files.");
+        System.out.println();
     };
-};
\ No newline at end of file
+};
diff --git a/src/main/java/de/ids_mannheim/korap/KorapResult.java b/src/main/java/de/ids_mannheim/korap/KorapResult.java
index 6b05e36..4c22cd7 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapResult.java
@@ -38,6 +38,8 @@
 	           benchmarkHitCounter = "0";
     private String error = null;
 
+    private JsonNode request;
+
     // Logger
     // This is KorapMatch instead of KorapResult!
     private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
@@ -129,6 +131,14 @@
 	this.error = msg;
     };
 
+    public void setRequest (JsonNode request) {
+	this.request = request;
+    };
+
+    public JsonNode getRequest () {
+	return this.request;
+    };
+
     public void setBenchmarkSearchResults (long t1, long t2) {
 	this.benchmarkSearchResults = (t2 - t1) * 1e-6 + " ms";
     };
diff --git a/src/main/java/de/ids_mannheim/korap/KorapSearch.java b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
index 30895fe..8843e31 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapSearch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
@@ -34,6 +34,8 @@
     private KorapIndex index;
     private String error;
 
+    private JsonNode request;
+
     public KorapSearchContext leftContext, rightContext;
 
     {
@@ -99,12 +101,12 @@
     public KorapSearch (String jsonString) {
 	ObjectMapper mapper = new ObjectMapper();
 	try {
-	    JsonNode json = mapper.readValue(jsonString, JsonNode.class);
-
+	    this.request = mapper.readValue(jsonString, JsonNode.class);
+	    
 	    // "query" value
-	    if (json.has("query")) {
+	    if (this.request.has("query")) {
 		try {
-		    this.query = new KorapQuery("tokens").fromJSON(json.get("query")).toQuery();
+		    this.query = new KorapQuery("tokens").fromJSON(this.request.get("query")).toQuery();
 		}
 		catch (QueryException q) {
 		    this.error = q.getMessage();
@@ -115,12 +117,12 @@
 	    };
 
 	    // "meta" virtual collections
-	    if (json.has("collections"))
+	    if (this.request.has("collections"))
 		this.setCollection(new KorapCollection(jsonString));
 
 	    if (this.error == null) {
-		if (json.has("meta")) {
-		    JsonNode meta = json.get("meta");
+		if (this.request.has("meta")) {
+		    JsonNode meta = this.request.get("meta");
 
 		    // Defined count
 		    if (meta.has("count"))
@@ -178,6 +180,10 @@
 	return this.query;
     };
 
+    public JsonNode getRequest () {
+	return this.request;
+    };
+
     public KorapSearch setQuery (SpanQueryWrapperInterface sqwi) {
 	this.query = sqwi.toQuery();
 	return this;
@@ -274,6 +280,7 @@
     public KorapResult run (KorapIndex ki) {
 	if (this.query == null) {
 	    KorapResult kr = new KorapResult();
+	    kr.setRequest(this.request);
 	    if (this.error != null)
 		kr.setError(this.error);
 	    else
@@ -283,11 +290,14 @@
 
 	if (this.error != null) {
 	    KorapResult kr = new KorapResult();
+	    kr.setRequest(this.request);
 	    kr.setError(this.error);
 	    return kr;
 	};
 
 	this.getCollection().setIndex(ki);
-	return ki.search(this.getCollection(), this);
+	KorapResult kr = ki.search(this.getCollection(), this);
+	kr.setRequest(this.request);
+	return kr;
     };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkElementSpans.java b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkElementSpans.java
new file mode 100644
index 0000000..e7d11a3
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkElementSpans.java
@@ -0,0 +1,131 @@
+package de.ids_mannheim.korap.benchmark;
+
+import java.util.*;
+import java.io.*;
+
+import de.ids_mannheim.korap.KorapIndex;
+import de.ids_mannheim.korap.index.FieldDocument;
+import de.ids_mannheim.korap.KorapCollection;
+import de.ids_mannheim.korap.KorapFilter;
+import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.KorapResult;
+import de.ids_mannheim.korap.KorapQuery;
+import org.apache.lucene.store.MMapDirectory;
+import de.ids_mannheim.korap.filter.BooleanFilter;
+import org.apache.lucene.search.spans.SpanQuery;
+import de.ids_mannheim.korap.query.wrap.SpanQueryWrapperInterface;
+import de.ids_mannheim.korap.util.QueryException;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.Ignore;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class TestBenchmarkElementSpans {
+
+    @Test
+    public void checkspans1 () throws IOException {
+	Properties prop = new Properties();
+	InputStream fr = new FileInputStream(getClass().getResource("/korap.conf").getFile());
+	prop.load(fr);
+
+	// Get the real index
+	KorapIndex ki = new KorapIndex(new MMapDirectory(new File(prop.getProperty("lucene.indexDir"))));
+
+	// Create a container for virtual collections:
+	KorapCollection kc = new KorapCollection(ki);
+
+	// Construct filter generator
+	// KorapFilter kf = new KorapFilter();
+
+	// The virtual collection consists of all documents that have
+	// the textClasses "reisen" and "freizeit"
+	//	kc.filter( kf.and("textClass", "reisen").and("textClass", "freizeit-unterhaltung") );
+
+	// This is real slow atm - sorry
+	// kc.filter(kf.and("textClass", "kultur"));
+
+
+	// Create a query
+	// KorapQuery kq = new KorapQuery("tokens");
+
+	long t1 = 0, t2 = 0;
+	t1 = System.nanoTime();
+
+	String json = getString(getClass().getResource("/queries/bsp19.jsonld").getFile());
+
+	int rounds = 1;
+
+	for (int i = 1; i <= rounds; i++) {
+	    /*
+	    SpanQuery query =
+		kq.within(
+			  kq.tag("xip/const:NPA"),
+			  kq._(1,
+			       kq.seq(
+				      kq._(2, kq.seg("cnx/p:A").with("mate/m:number:sg"))
+				      ).append(
+					       kq.seg("opennlp/p:NN").with("tt/p:NN")
+					       )
+			       )
+			  ).toQuery();
+	    */
+	    // SpanQuery query = kq.tag("s").toQuery();
+
+	    KorapResult kr = new KorapSearch(json).run(ki);
+	    System.err.println(kr.toJSON());
+	};
+
+	t2 = System.nanoTime();
+	
+	System.out.println("It took " + ((t2 - t1) / rounds) * 1e-6 + " ms per query");
+
+
+
+	//	kc = new KorapCollection("{\"meta\":[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"A00\"}},{\"@type\":\"korap:meta-extend\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"A01\"}}]}");
+
+	//	kc = new KorapCollection("{\"meta\":[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"A01\"}}]}");
+	/*
+	kc = new KorapCollection("{\"meta\":[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#textClass\",\"@value\":\"reisen\"}}]}");
+	kc.setIndex(ki);
+
+	System.err.println(kc.getFilter(0).toString());
+	System.err.println(kc.numberOf("documents"));
+
+	*/
+
+	// assertEquals(14, kc.numberOf("documents"));
+    };
+
+    public static String getString (String path) {
+	StringBuilder contentBuilder = new StringBuilder();
+	try {
+	    BufferedReader in = new BufferedReader(new FileReader(path));
+	    String str;
+	    while ((str = in.readLine()) != null) {
+		contentBuilder.append(str);
+	    };
+	    in.close();
+	} catch (IOException e) {
+	    fail(e.getMessage());
+	}
+	return contentBuilder.toString();
+    };
+
+    public static SpanQueryWrapperInterface jsonQuery (String jsonFile) {
+	SpanQueryWrapperInterface sqwi;
+	
+	try {
+	    String json = getString(jsonFile);
+	    sqwi = new KorapQuery("tokens").fromJSON(json);
+	}
+	catch (QueryException e) {
+	    fail(e.getMessage());
+	    sqwi = new KorapQuery("tokens").seg("???");
+	};
+	return sqwi;
+    };
+    
+};
diff --git a/src/test/resources/queries/bsp19.jsonld b/src/test/resources/queries/bsp19.jsonld
new file mode 100644
index 0000000..5710602
--- /dev/null
+++ b/src/test/resources/queries/bsp19.jsonld
@@ -0,0 +1,46 @@
+{
+    "@context" : "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld",
+    "query" : {
+	"@type" : "korap:group",
+	"operation" : "operation:sequence",
+	"inOrder" : true,
+	"distances" : [ {
+	    "@type" : "korap:distance",
+	    "key" : "w",
+	    "min" : 1,
+	    "max" : 3
+	}, {
+	    "@type" : "korap:distance",
+	    "key" : "s",
+	    "min" : 0,
+	    "max" : 1
+	} ],
+	"operands" : [ {
+	    "@type" : "korap:token",
+	    "wrap" : {
+		"@type" : "korap:term",
+		"key" : "das",
+		"layer" : "orth",
+		"match" : "match:eq"
+	    }
+	}, {
+	    "@type" : "korap:token",
+	    "wrap" : {
+		"@type" : "korap:term",
+		"key" : "Buch",
+		"layer" : "orth",
+		"match" : "match:eq"
+	    }
+	}
+		     ]
+    },
+    "meta" : {
+	"count":25,
+	"cutOff":true,
+	"context":{
+	    "left":["char",110],
+	    "right":["char",110]
+	},
+	"startPage":1
+    }
+}
