diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
index 5ce6bb5..0ae5be3 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
@@ -12,6 +12,7 @@
 
 import de.ids_mannheim.korap.query.spans.ElementDistanceSpan;
 import de.ids_mannheim.korap.query.spans.TokenDistanceSpan;
+import de.ids_mannheim.korap.query.spans.UnorderedDistanceSpans;
 
 /** Match two ordered Spans with minimum and maximum distance constraints.
  * 	The distance unit can be word (token), sentence or paragraph. 
@@ -21,27 +22,28 @@
 public class SpanDistanceQuery extends SimpleSpanQuery {
 	
 	protected int minDistance, maxDistance;
-	protected boolean collectPayloads;
+	protected boolean isOrdered, collectPayloads;
 	protected SpanQuery firstClause, secondClause; 
 	private SpanQuery elementQuery; // element distance unit
-	
+
 	public SpanDistanceQuery(SpanQuery firstClause, SpanQuery secondClause, 
-			int minDistance, int maxDistance, boolean collectPayloads) {
-		super(firstClause, secondClause, "spanDistance");		
+			int minDistance, int maxDistance, boolean isOrdered, 
+			boolean collectPayloads) {
+		super(firstClause, secondClause, "spanDistance");
     	this.firstClause=firstClause;
     	this.secondClause=secondClause;
     	this.minDistance =minDistance;
 		this.maxDistance = maxDistance;
+		this.isOrdered = isOrdered;
 		this.collectPayloads = collectPayloads;
 	}
 	
-	public SpanDistanceQuery(SpanQuery elementQuery, 
-			SpanQuery firstClause, SpanQuery secondClause, 
-			int minDistance, int maxDistance, 
-			boolean collectPayloads) {
-		this(firstClause, secondClause,minDistance, maxDistance, 
+	public SpanDistanceQuery(SpanQuery elementQuery, SpanQuery firstClause, 
+			SpanQuery secondClause, int minDistance, int maxDistance, 
+			boolean isOrdered, 	boolean collectPayloads) {
+		this(firstClause, secondClause, minDistance, maxDistance, isOrdered, 
 				collectPayloads);
-		this.elementQuery = elementQuery;    	    	
+		this.elementQuery = elementQuery;
 	}
 	
 	@Override
@@ -51,6 +53,7 @@
 		    (SpanQuery) secondClause.clone(),
 		    this.minDistance,
 		    this.maxDistance,
+		    this.isOrdered,
 		    this.collectPayloads
         );
 		
@@ -66,10 +69,16 @@
 	public Spans getSpans(AtomicReaderContext context, Bits acceptDocs,
 			Map<Term, TermContext> termContexts) throws IOException {
 		
-		if (this.elementQuery != null) 
-			return new ElementDistanceSpan(this, context, acceptDocs, termContexts);		
-		
-		return new TokenDistanceSpan(this, context, acceptDocs, termContexts);
+		if (isOrdered){
+			if (this.elementQuery != null) {
+				return new ElementDistanceSpan(this, context, acceptDocs, termContexts);		
+			}
+			return new TokenDistanceSpan(this, context, acceptDocs, termContexts);
+		}
+		else if (this.elementQuery != null) {
+			//return new ElementDistanceSpan(this, context, acceptDocs, termContexts);		
+		}
+		return new UnorderedDistanceSpans(this, context, acceptDocs, termContexts);
 	}
 
 	public int getMinDistance() {
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpan.java b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpan.java
index 103fd14..2f48020 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpan.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpan.java
@@ -127,9 +127,4 @@
 		return advance();
 	}
 
-	@Override
-	public long cost() {
-		CandidateSpan candidateSpan = candidateList.get(candidateListIndex);
-		return candidateSpan.getCost() + secondSpans.cost();
-	}
 }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpan.java b/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpan.java
index 5990029..a4f26fc 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpan.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpan.java
@@ -92,5 +92,11 @@
 		}		
 		return false;
 	}
+	
+	@Override
+	public long cost() {
+		CandidateSpan candidateSpan = candidateList.get(candidateListIndex);
+		return candidateSpan.getCost() + secondSpans.cost();
+	}
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestDistanceQuery.java b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
similarity index 86%
rename from src/test/java/de/ids_mannheim/korap/index/TestDistanceQuery.java
rename to src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
index 11f5a04..8e131d5 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestDistanceQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
@@ -18,11 +18,11 @@
 import de.ids_mannheim.korap.query.SpanSegmentQuery;
 
 @RunWith(JUnit4.class)
-public class TestDistanceQuery {
+public class TestDistanceIndex {
     KorapResult kr;
     KorapIndex ki;   
  
-    private FieldDocument createFieldDoc0() {
+    protected FieldDocument createFieldDoc0() {
     	FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base",
@@ -36,7 +36,7 @@
         return fd;
 	}
     
-    private FieldDocument createFieldDoc1(){
+    protected FieldDocument createFieldDoc1(){
     	FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base",
@@ -54,7 +54,7 @@
         return fd;
     }
     
-    private FieldDocument createFieldDoc2() {
+    protected FieldDocument createFieldDoc2() {
     	FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV("base",
@@ -68,23 +68,25 @@
         return fd;
 	}
     
-    private SpanQuery createQuery(String x, String y, int min, int max){
+    protected SpanQuery createQuery(String x, String y, int min, int max, boolean isOrdered){
     	SpanQuery sq = new SpanDistanceQuery(
         		new SpanTermQuery(new Term("base",x)),
         		new SpanTermQuery(new Term("base",y)),
         		min,
         		max,
+        		isOrdered,
         		true
         );
     	return sq;
     }
     
-    private SpanQuery createElementQuery(String x, String y, int min, int max){
+    protected SpanQuery createElementQuery(String x, String y, int min, int max, boolean isOrdered){
     	SpanQuery sq = new SpanDistanceQuery(
         		new SpanElementQuery("base",x),
         		new SpanElementQuery("base",y),
         		min,
         		max,
+        		isOrdered,
         		true
         );
     	return sq;
@@ -101,7 +103,7 @@
         ki.commit();
         SpanQuery sq;
         // ---- Distance 0 to 1
-        sq = createQuery("s:b","s:c",0,1);                
+        sq = createQuery("s:b","s:c",0,1,true);                
         kr = ki.search(sq, (short) 10);
         
         assertEquals(2, kr.totalResults());
@@ -111,7 +113,7 @@
         assertEquals(3, kr.match(1).endPos);
         
         // ---- Distance 2 to 2
-        sq = createQuery("s:b","s:c",2,2);                
+        sq = createQuery("s:b","s:c",2,2,true);                
         kr = ki.search(sq, (short) 10);
         
         assertEquals(2, kr.totalResults());
@@ -121,7 +123,7 @@
         assertEquals(4, kr.match(1).endPos);
         
         // ---- Distance 2 to 3
-        sq = createQuery("s:b","s:c",2,3);                
+        sq = createQuery("s:b","s:c",2,3,true);                
         kr = ki.search(sq, (short) 10);
         
         assertEquals(3, kr.totalResults());
@@ -142,7 +144,7 @@
 	    
 	    // ---- Distance 1 to 3
 	    // Candidate list for the current secondspan, is empty
-	    SpanQuery sq = createQuery("s:c","s:d",1,3);                
+	    SpanQuery sq = createQuery("s:c","s:d",1,3,true);                
 	    kr = ki.search(sq, (short) 10);
 	        	    
 	    assertEquals(4, kr.getTotalResults());
@@ -156,7 +158,7 @@
 
 	    // ---- Distance 3 to 3
 	    // Candidate list is empty, but there are secondspans in the other doc
-	    sq = createQuery("s:c","s:d",3,3);                
+	    sq = createQuery("s:c","s:d",3,3,true);                
 	    kr = ki.search(sq, (short) 10);
 	    assertEquals(2, kr.getTotalResults());
 	    
@@ -176,7 +178,7 @@
         ki.commit();
         
         SpanQuery sq;
-        sq = createQuery("s:c","s:d",3,3);    
+        sq = createQuery("s:c","s:d",3,3,true);    
         kr = ki.search(sq, (short) 10);
         
         assertEquals(2, kr.totalResults());
@@ -197,7 +199,7 @@
         ki.commit();
                
         // ---- Distance 1 to 2
-        SpanQuery sq = createQuery("s:b","s:c",1,2);                
+        SpanQuery sq = createQuery("s:b","s:c",1,2,true);                
         kr = ki.search(sq, (short) 10);
         
         assertEquals(3, kr.totalResults());
@@ -218,7 +220,7 @@
 	    ki.commit();    
 	    
 	    // Intersection ---- Distance 0:0
-	    SpanQuery sq = createElementQuery("x","y",0,0);                
+	    SpanQuery sq = createElementQuery("x","y",0,0,true);                
 	    kr = ki.search(sq, (short) 10);
     	
 	    assertEquals(4, kr.totalResults());
@@ -230,7 +232,7 @@
 	    assertEquals(8, kr.getMatch(2).endPos);
     	
 	    // Next to ---- Distance 1:1
-	    sq = createElementQuery("y","x",1,1);                
+	    sq = createElementQuery("y","x",1,1,true);                
 	    kr = ki.search(sq, (short) 10);
 	    
 	    assertEquals(1, kr.totalResults());
@@ -238,7 +240,7 @@
 	    assertEquals(10, kr.getMatch(0).endPos);
 	    
 	    // ---- Distance 1:2
-	    sq = createElementQuery("y","x",1,2);                
+	    sq = createElementQuery("y","x",1,2,true);                
 	    kr = ki.search(sq, (short) 10);
 	    
 	    assertEquals(2, kr.totalResults());	    
@@ -248,17 +250,10 @@
 	    assertEquals(10, kr.getMatch(1).endPos);
 	    
 	    // The same element type ---- Distance 1:2
-	    sq = createElementQuery("x","x",1,2);
+	    sq = createElementQuery("x","x",1,2,true);
 	    kr = ki.search(sq, (short) 10);
 	    
 	    assertEquals(2, kr.totalResults());
-	    
-//    	System.out.print(kr.getTotalResults()+"\n");
-//		for (int i=0; i< kr.getTotalResults(); i++){
-//			System.out.println(
-//				kr.match(i).startPos + " " +kr.match(i).endPos
-//		    );
-//		}
     }
     
     /** Skip to */    
@@ -269,7 +264,7 @@
 	    ki.addDoc(createFieldDoc1());
 	    ki.commit();
 	    	    
-	    SpanQuery firstClause = createQuery("s:d", "s:e", 3, 4);
+	    SpanQuery firstClause = createQuery("s:d", "s:e", 3, 4,true);
 	    kr = ki.search(firstClause, (short) 10); 
 	    
 	    assertEquals(3, kr.totalResults());
@@ -284,8 +279,8 @@
 	    
 		// The secondspans is skipped to doc# of the current firstspans
 		SpanQuery sq = new SpanSegmentQuery(
-	    		createQuery("s:d","s:e",3,4),
-	    		createElementQuery("y","x",1,2)
+	    		createQuery("s:d","s:e",3,4,true),
+	    		createElementQuery("y","x",1,2,true)
 		);	    
 	    kr = ki.search(sq, (short) 10);
 	    
