diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndex.java b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
index 9359848..a2a5c7f 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
@@ -666,7 +666,7 @@
 
 		    match.setAuthor(doc.get("author"));
 		    match.setTextClass(doc.get("textClass"));
-		    match.setID(doc.get("ID"));
+		    match.setDocID(doc.get("ID"));
 		    match.setTitle(doc.get("title"));
 		    match.setSubTitle(doc.get("subTitle"));
 		    match.setPubPlace(doc.get("pubPlace"));
@@ -682,10 +682,9 @@
 		    match.setLayerInfo(doc.get("layerInfo"));
 
 		    match.setPrimaryData(
-		      new KorapPrimaryData(doc.get(foundry))
+		        new KorapPrimaryData(doc.get(foundry))
 		    );
 		    atomicMatches.add(match);
-		    // kr.add(match);
 		};
 
 		// Benchmark till now
@@ -709,7 +708,8 @@
 	    if (kr.getBenchmarkSearchResults().length() == 0) {
 		kr.setBenchmarkSearchResults(t2, t1);
 	    };
-	    kr.setTotalResults(i);
+
+	    kr.setTotalResults(cutoff ? -1 : i);
 	}
 	catch (IOException e) {
 	    kr.setError("There was an IO error");
@@ -718,38 +718,4 @@
 
 	return kr;
     };
-
-
-	/*
-
-    public void getFoundryStatistics {
-- provides statistical information:
-  - which documents have which foundries
-    - Collect all Bitvectors of each foundry and make the intersections afterwards
-  - ???
-    };
-
-
-    public KorapResult search (Bits bits, KorapQuery query) {
-	//	this.search(bits, query);
-    };
-
-    // countAllTokens
-    public int getNumberOfTokens (String corpus) throws IOException {
-	return this.getNumberOf("token", "base", corpus);
-    };
-
-
-    // retrieveTokens(docname, startOffset, endOffset, layer);
-
-
-    /*
-
-
-    // todo mit pagesize und offset
-
-
-    };
-*/
-
 };
diff --git a/src/main/java/de/ids_mannheim/korap/KorapMatch.java b/src/main/java/de/ids_mannheim/korap/KorapMatch.java
index 38e32d2..b87a076 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapMatch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapMatch.java
@@ -120,6 +120,10 @@
 	return super.getID();
     };
 
+    public void setDocID (String id) {
+	super.setID(id);
+    };
+
     @Override
     @JsonProperty("ID")
     public String getID () {
diff --git a/src/main/java/de/ids_mannheim/korap/KorapSearch.java b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
index d7401ed..8733a38 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapSearch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
@@ -16,32 +16,34 @@
 
 /*
   Todo: Let this class extend KorapResult!
-  Todo: implement an empty new Result Thingy!
   KorapResult = new KorapSearch(String json).run(KorapIndex ki);
-  startPage!!!
 */
 
+/**
+ * @author Nils Diewald
+ *
+ * KoraSearch implements an object for all search relevant parameters.
+ */
 public class KorapSearch {
-    private int startIndex;
-    private short count = 25;
-    private short countMax = 50;
-    private int limit = 0;
+    private int startIndex = 0, limit = 0;
+    private short count = 25,
+	          countMax = 50;
     private boolean cutoff = false;
     private SpanQuery query;
-    public KorapSearchContext leftContext, rightContext;
     private KorapCollection collection;
     private KorapIndex index;
     private String error;
 
+    public KorapSearchContext leftContext, rightContext;
+
     {
-	leftContext = new KorapSearchContext();
+	leftContext  = new KorapSearchContext();
 	rightContext = new KorapSearchContext();
     };
 
     public class KorapSearchContext {
 	private boolean type = true;
-	private short length = 6;
-	private short maxLength = 300;
+	private short length = 6, maxLength = 300;
 
 	public boolean isToken () {
 	    return this.type;
@@ -72,7 +74,7 @@
 		}
 		else {
 		    this.length = this.maxLength;
-		}
+		};
 	    };
 	    return this;
 	};
@@ -99,6 +101,7 @@
 	try {
 	    JsonNode json = mapper.readValue(jsonString, JsonNode.class);
 
+	    // "query" value
 	    if (json.has("query")) {
 		try {
 		    this.query = new KorapQuery("tokens").fromJSON(json.get("query")).toQuery();
@@ -111,10 +114,9 @@
 		this.error = "No query defined";
 	    };
 
-	    if (json.has("meta")) {
-		KorapCollection kc = new KorapCollection(jsonString);
-		this.setCollection(kc);
-	    };
+	    // "meta" virtual collections
+	    if (json.has("meta"))
+		this.setCollection(new KorapCollection(jsonString));
 
 	    if (this.error == null) {
 
@@ -139,12 +141,14 @@
 		    JsonNode context = json.get("context");
 		    if (context.has("left"))
 			this.leftContext.fromJSON(context.get("left"));
+
 		    if (context.has("right"))
 			this.rightContext.fromJSON(context.get("right"));
-
 		};
 	    };
 	}
+
+	// Unable to parse JSON
 	catch (IOException e) {
 	    this.error = e.getMessage();
 	};
@@ -160,6 +164,7 @@
 	this.query = sq;
     };
 
+    // Empty constructor
     public KorapSearch () { };
 
     public SpanQuery getQuery () {
@@ -237,12 +242,10 @@
 
     public KorapSearch setCount (short value) {
 	if (value > 0) {
-	    if (value <= this.countMax) {
+	    if (value <= this.countMax)
 		this.count = value;
-	    }
-	    else {
+	    else
 		this.count = this.countMax;
-	    };
 	};
 	return this;
     };
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanNextQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanNextQuery.java
index 370be81..0fd90e8 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanNextQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanNextQuery.java
@@ -33,8 +33,7 @@
 /** Matches spans which are directly next to each other.
  */
 public class SpanNextQuery extends SpanQuery implements Cloneable {
-    private SpanQuery firstClause;
-    private SpanQuery secondClause;
+    private SpanQuery firstClause, secondClause;
     public String field;
     private boolean collectPayloads;
 
@@ -42,8 +41,7 @@
     private final static Logger log = LoggerFactory.getLogger(SpanNextQuery.class);
 
     // Constructor
-    public SpanNextQuery(SpanQuery firstClause,
-			 SpanQuery secondClause) {
+    public SpanNextQuery(SpanQuery firstClause, SpanQuery secondClause) {
 	this(firstClause, secondClause, true);
     };
 
@@ -54,7 +52,7 @@
 
 	this.field = secondClause.getField();
 	if (!firstClause.getField().equals(field)) {
-	    throw new IllegalArgumentException("Clauses must have same field.");
+	    throw new IllegalArgumentException("Clauses must have same field");
 	};
 
 	this.collectPayloads = collectPayloads;
@@ -79,14 +77,14 @@
 
     @Override
     public String toString(String field) {
-	StringBuilder buffer = new StringBuilder();
-	buffer.append("spanNext(");
-	buffer.append(firstClause.toString(field));
-        buffer.append(", ");
-	buffer.append(secondClause.toString(field));
-	buffer.append(")");
-	buffer.append(ToStringUtils.boost(getBoost()));
-	return buffer.toString();
+	StringBuilder sb = new StringBuilder();
+	sb.append("spanNext(")
+          .append(firstClause.toString(field))
+          .append(", ")
+          .append(secondClause.toString(field))
+          .append(")")
+          .append(ToStringUtils.boost(getBoost()));
+	return sb.toString();
     };
 
     @Override
@@ -96,17 +94,14 @@
 
 	log.trace("Get Spans");
 	return (Spans) new NextSpans (
-            this, context, acceptDocs, termContexts, collectPayloads
+	    this, context, acceptDocs, termContexts, collectPayloads
 	);
     };
 
     @Override
     public Query rewrite (IndexReader reader) throws IOException {
-	// System.err.println(">> Rewrite query");
-
 	SpanNextQuery clone = null;
 
-	// System.err.println(">> Rewrite first clause");
 	SpanQuery query = (SpanQuery) firstClause.rewrite(reader);
 
 	if (query != firstClause) {
@@ -115,7 +110,6 @@
 	    clone.firstClause = query;
 	};
 
-	// System.err.println(">> Rewrite second clause");
 	query = (SpanQuery) secondClause.rewrite(reader);
 	if (query != secondClause) {
 	    if (clone == null)
@@ -123,10 +117,8 @@
 	    clone.secondClause = query;
 	};
 
-	if (clone != null) {
-	    // System.err.println(">> Clone is not null");
+	if (clone != null)
 	    return clone;
-	};
 
 	return this;
     };
@@ -153,7 +145,7 @@
 	final SpanNextQuery spanNextQuery = (SpanNextQuery) o;
 	
 	if (collectPayloads != spanNextQuery.collectPayloads) return false;
-	if (!firstClause.equals(spanNextQuery.firstClause)) return false;
+	if (!firstClause.equals(spanNextQuery.firstClause))   return false;
 	if (!secondClause.equals(spanNextQuery.secondClause)) return false;
 
 	return getBoost() == spanNextQuery.getBoost();
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
index f70ef99..9ce6090 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
@@ -213,6 +213,36 @@
 	assertEquals(5, kr.getItemsPerPage());
     };
 
+    @Test
+    public void searchJSONstartPage () throws IOException {
+
+	// Construct index
+	KorapIndex ki = new KorapIndex();
+	// Indexing test files
+	for (String i : new String[] {"00001", "00002", "00003", "00004", "00005", "00006", "02439"}) {
+	    ki.addDocFile(
+	      getClass().getResource("/wiki/" + i + ".json.gz").getFile(), true
+            );
+	};
+	ki.commit();
+
+	String json = getString(getClass().getResource("/queries/bsp-paging.json").getFile());
+
+	KorapSearch ks = new KorapSearch(json);
+	KorapResult kr = ks.run(ki);
+	assertEquals(10, kr.getTotalResults());
+	assertEquals(5, kr.getStartIndex());
+	assertEquals(5, kr.getItemsPerPage());
+
+	json = getString(getClass().getResource("/queries/bsp-cutoff.json").getFile());
+	ks = ks = new KorapSearch(json);
+
+	kr = ks.run(ki);
+	assertEquals(-1, kr.getTotalResults());
+	assertEquals(2, kr.getStartIndex());
+	assertEquals(2, kr.getItemsPerPage());
+
+    };
 
 
     public static String getString (String path) {
diff --git a/src/test/resources/queries/bsp-cutoff.json b/src/test/resources/queries/bsp-cutoff.json
new file mode 100644
index 0000000..0f1f834
--- /dev/null
+++ b/src/test/resources/queries/bsp-cutoff.json
@@ -0,0 +1,36 @@
+{
+    "@context": {
+        "@language": "de", 
+        "class": {
+            "@id": "korap:class", 
+            "@type": "xsd:integer"
+        }, 
+        "filter": "korap:filter", 
+        "korap": "http://korap.ids-mannheim.de/ns/query", 
+        "meta": "korap:meta", 
+        "operands": {
+            "@container": "@list", 
+            "@id": "korap:operands"
+        }, 
+        "query": "korap:query", 
+        "relation": {
+            "@id": "korap:relation", 
+            "@type": "korap:relation#types"
+        }
+    }, 
+    "query": {
+        "@type": "korap:token", 
+        "@value": {
+            "@type": "korap:term", 
+            "@value": "base:alphabet", 
+            "relation": "="
+        }
+    },
+    "startPage":2,
+    "count": 2,
+    "cutOff": true,
+    "context":{
+      "left":["char",90],
+      "right":["char",90]
+    }
+}
diff --git a/src/test/resources/queries/bsp-paging.json b/src/test/resources/queries/bsp-paging.json
new file mode 100644
index 0000000..ac352a7
--- /dev/null
+++ b/src/test/resources/queries/bsp-paging.json
@@ -0,0 +1,35 @@
+{
+    "@context": {
+        "@language": "de", 
+        "class": {
+            "@id": "korap:class", 
+            "@type": "xsd:integer"
+        }, 
+        "filter": "korap:filter", 
+        "korap": "http://korap.ids-mannheim.de/ns/query", 
+        "meta": "korap:meta", 
+        "operands": {
+            "@container": "@list", 
+            "@id": "korap:operands"
+        }, 
+        "query": "korap:query", 
+        "relation": {
+            "@id": "korap:relation", 
+            "@type": "korap:relation#types"
+        }
+    }, 
+    "query": {
+        "@type": "korap:token", 
+        "@value": {
+            "@type": "korap:term", 
+            "@value": "base:alphabet", 
+            "relation": "="
+        }
+    },
+    "startPage":2,
+    "count": 5,
+    "context":{
+      "left":["char",90],
+      "right":["char",90]
+    }
+}
