diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpan.java b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpan.java
index 11ef837..d51a70d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpan.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpan.java
@@ -12,16 +12,15 @@
 
 import de.ids_mannheim.korap.query.SpanDistanceQuery;
 
-/** Enumeration of element-based distance span matches. 
- * 	The distance unit is an element position, including a gap.
- * 	For example:  
- * 	X &lt;p&gt;&lt;/p&gt;
- * 	Z
- * 	&lt;p&gt;&lt;/p&gt; Y. 
- * 	X and Y has a distance of 4.
+/** Span enumeration of element-based distance span matches. 	
+ * 	Each match consists of two child spans. The element-distance between 
+ * 	the child spans is the difference between the element position numbers 
+ * 	where the child spans are. The element-distance unit can be a sentence 
+ * 	or a paragraph. All other child spans occurrence which are not in 
+ * 	a sentence or a paragraph (with respect to the element distance type 
+ * 	current used) are ignored.
  * 
- *	@author margaretha
- *	@deprecated 
+ * @author margaretha
  * */
 public class ElementDistanceSpan extends DistanceSpan {
 			
@@ -29,9 +28,6 @@
 	private Spans elements;	
 	private int elementPosition, secondSpanPostion;	
 		
-	private boolean isGap; // refers to the gap right before the current element
-	private int gapPosition;
-	
 	public ElementDistanceSpan(SpanDistanceQuery query,
 			AtomicReaderContext context, Bits acceptDocs,
 			Map<Term, TermContext> termContexts)
@@ -83,87 +79,51 @@
 		} 		
 	}
 	
-	/** Add new possible candidates
+	/** Add new possible candidates. Candidates must be in an element 
+	 * 	and not too far from the secondspan.
 	 * */
-	private void addNewCandidates() throws IOException{
-		int position;
+	private void addNewCandidates() throws IOException{		
 		while ( hasMoreFirstSpans && 
 				firstSpans.doc() == candidateListDocNum &&
 				firstSpans.start() < secondSpans.end()){
 			
-			advanceElementTo(firstSpans);
-			position = findPosition(firstSpans);
-			candidateList.add(new CandidateSpan(firstSpans,position));
-			filterCandidateList(position);
+			if (advanceElementTo(firstSpans)){
+				candidateList.add(new CandidateSpan(firstSpans,elementPosition));				
+				filterCandidateList(elementPosition);
+			}
 			hasMoreFirstSpans = firstSpans.next();
 		}
 		
-		secondSpanPostion = findSecondSpanPosition();
-		filterCandidateList(secondSpanPostion);
+		if (advanceElementTo(secondSpans)){
+			secondSpanPostion = elementPosition;
+			filterCandidateList(secondSpanPostion);
+		}
+		// second span is not in an element
+		else { candidateList.clear(); }
 	}
 	
-	/** Advance elements until encountering the span. 
-	 * 	Add the elementPosition while searching.
-	 *  Add gap positions too. 
+	/** Advance elements until encountering a span.
+	 * @return true iff an element containing the span, is found.
 	 */
-	private void advanceElementTo(Spans span) throws IOException{	
-		isGap = false;
-		int prevElementEnd = elements.end();
+	private boolean advanceElementTo(Spans span) throws IOException{
 		while (hasMoreElements && 
 				elements.doc() == candidateListDocNum &&
-				elements.end() <= span.start()){			
+				elements.start() < span.end()){
 			
-			// Find a gap
-			if (prevElementEnd < elements.start()){
-				elementPosition++;
+			if (span.start() >= elements.start() &&
+					span.end() <= elements.end()){
+				return true;
 			}
-			
-			prevElementEnd = elements.end();
+
 			hasMoreElements = elements.next();
 			elementPosition++;
 		}
-		
-		// Find the last gap between the prevElement and current element
-		if (hasMoreElements && 
-				elements.doc() == candidateListDocNum &&	
-				prevElementEnd < elements.start()){			
-			isGap = true;			
-			gapPosition = elementPosition;
-			elementPosition++;			
-		}
-		
+		return false;
 	}
-
-	/** Find a span position which can be
-	 * 		in the current element,
-	 *  	in the gap between the previous and current element,
-	 *  	in the very last gap at the end of a doc.
-	 * @return the span position    
+	
+	/** Reduce the number of candidates by removing all candidates that are 
+	 * 	not within a max distance from the given element position.
 	 * */
-	private int findPosition(Spans span){
-		int position = elementPosition;
-		
-		// in the gap
-		if (isGap && span.end() <= elements.start())
-			position = gapPosition;
-		
-		return position;
-	}
-	
-	
-	private int findSecondSpanPosition() throws IOException{		
-		// in the gap
-		if (isGap && secondSpans.end() <= elements.start()){
-			return gapPosition;					
-		}
-		// in current element
-		else if (secondSpans.end() <= elements.end()){
-			return elementPosition;
-		}					
-		advanceElementTo(secondSpans);	
-		return findPosition(secondSpans);		
-	}
-
 	private void filterCandidateList(int position){
 		Iterator<CandidateSpan> i = candidateList.iterator();
 		CandidateSpan cs;
@@ -175,6 +135,7 @@
 			}
 			i.remove();
 		}
+		
 		//System.out.println("pos "+position+" " +candidateList.size());
 	}		
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceSpan.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceSpan.java
new file mode 100644
index 0000000..366db87
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceSpan.java
@@ -0,0 +1,138 @@
+package de.ids_mannheim.korap.index;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.spans.SpanQuery;
+import org.apache.lucene.search.spans.SpanTermQuery;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+import de.ids_mannheim.korap.KorapIndex;
+import de.ids_mannheim.korap.KorapResult;
+import de.ids_mannheim.korap.query.SpanDistanceQuery;
+import de.ids_mannheim.korap.query.SpanElementQuery;
+
+@RunWith(JUnit4.class)
+public class TestElementDistanceSpan {
+	
+	KorapResult kr;
+    KorapIndex ki;   
+    
+	private FieldDocument createFieldDoc0() {
+    	FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-0");
+        fd.addTV("base",
+            "text",             
+            "[(0-1)s:b|s:c|_1#0-1|<>:s#0-2$<i>1]" +
+            "[(1-2)s:b|_2#1-2]" +             
+            "[(2-3)s:c|_3#2-3|<>:s#2-3$<i>3]" +
+            "[(3-4)s:b|_4#3-4|<>:s#3-4$<i>4]" + 
+            "[(4-5)s:b|_5#4-5|<>:s#4-5$<i>5]" +             
+            "[(5-6)s:b|_6#5-6]" +
+            "[(6-7)s:c|_7#6-7]");
+        return fd;
+	}
+	
+	
+	private FieldDocument createFieldDoc1() {
+    	FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-1");
+        fd.addTV("base",
+            "text",             
+            "[(0-1)s:e|_1#0-1|<>:s#0-2$<i>1]" +
+            "[(1-2)s:c|s:b|_2#1-2|<>:s#1-2$<i>2]" +             
+            "[(2-3)s:e|_3#2-3|<>:s#2-3$<i>3]" +
+            "[(3-4)s:b|_4#3-4|<>:s#3-4$<i>4]" + 
+            "[(4-5)s:d|_5#4-5|<>:s#4-5$<i>5]" +             
+            "[(5-6)s:c|_6#5-6|<>:s#5-6$<i>6]");
+        return fd;
+	}
+	
+	private FieldDocument createFieldDoc2() {
+    	FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-0");
+        fd.addTV("base",
+            "text",             
+            "[(0-1)s:b|_1#0-1|<>:p#0-2$<i>1]" +
+            "[(1-2)s:b|_2#1-2]" +             
+            "[(2-3)s:b|_3#2-3|<>:p#2-3$<i>3]" +
+            "[(3-4)s:d|_4#3-4|<>:p#3-4$<i>4]" + 
+            "[(4-5)s:d|_5#4-5|<>:p#4-5$<i>5]" +             
+            "[(5-6)s:d|_6#5-6]");
+        return fd;
+	}
+	
+	public SpanQuery createQuery(String elementType, String x, String y, 
+			int minDistance, int maxDistance){        
+		return new SpanDistanceQuery(
+        		new SpanElementQuery("base", elementType), 
+        		new SpanTermQuery(new Term("base",x)), 
+        		new SpanTermQuery(new Term("base",y)), 
+        		minDistance, 
+        		maxDistance, 
+        		true);
+	}
+	
+	
+	/**	Multiple documents
+	 * 	Ensure terms and elements are in the same doc
+	 * 	Ensure terms are in elements
+	 *  Check filter candidate list
+	 * */
+	@Test
+	public void testCase1() throws IOException{
+		System.out.println("testCase1");
+		ki = new KorapIndex();
+        ki.addDoc(createFieldDoc0()); 
+        ki.addDoc(createFieldDoc1());        
+        ki.commit();
+        
+        SpanQuery sq;        
+        sq = createQuery("s", "s:b", "s:c", 1, 2);        
+        kr = ki.search(sq, (short) 10);
+        
+//        assertEquals(4, kr.totalResults());
+//        assertEquals(0, kr.match(0).startPos);
+//        assertEquals(1, kr.match(0).endPos);
+//        assertEquals(0, kr.match(1).startPos);
+//        assertEquals(3, kr.match(1).endPos);
+        
+//        System.out.print(kr.getTotalResults()+"\n");
+//   		for (int i=0; i< kr.getTotalResults(); i++){
+//   			System.out.println(
+//   				kr.match(i).getLocalDocID()+" "+
+//   				kr.match(i).startPos + " " +
+//   				kr.match(i).endPos
+//   		    );
+//   		}
+         
+	}
+	
+	/** Ensure terms and elements are in the same doc
+	 * */
+	@Test
+	public void testCase2() throws IOException{
+		System.out.println("testCase2");
+		ki = new KorapIndex();
+        ki.addDoc(createFieldDoc0()); 
+        ki.addDoc(createFieldDoc1());
+        ki.addDoc(createFieldDoc2());
+        ki.commit();
+        
+        SpanQuery sq;
+        sq = createQuery("p", "s:b", "s:d", 1, 1);
+        kr = ki.search(sq, (short) 10);
+        
+//        assertEquals(1, kr.totalResults());
+//        assertEquals(2, kr.match(0).getLocalDocID());
+//        assertEquals(2, kr.match(0).startPos);
+//        assertEquals(4, kr.match(0).endPos);
+        
+	}	
+	
+	
+}
