diff --git a/Changes b/Changes
index dd2c125..8e8c720 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,13 @@
+0.55.5 2016-04-25
+	- [bugfix] store skipped spans in Repetitionspans as candidates
 0.55.4 2016-04-22
-        - [bugfix] Wrap <base/s=t> boundaries around right extended queries
+    - [bugfix] Wrap <base/s=t> boundaries around right extended queries
 	  (diewald)
 	- [bugfix] Lazy loading bug in WithinSpans (diewald)
+	- [feature] Matching relation nodes with attributes
+	- [bugfix and update] Removed span id in SegmentSpans, added in NextSpans
+	Updated relation deserialization
+	Added tests for relation queries and relation deserialization 
 	- [bugfix] Workaround for Nullpointers in SpanOrQuery (diewald)
 
 0.55.3 2016-02-22
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
index dad2fe5..5b5c33a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
@@ -4,6 +4,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -35,6 +36,7 @@
     private int min, max;
     private long matchCost;
     private List<CandidateSpan> matchList;
+    private List<CandidateSpan> candidates;
 
     /**
      * Constructs RepetitionSpans from the given
@@ -55,6 +57,7 @@
         this.min = query.getMin();
         this.max = query.getMax();
         matchList = new ArrayList<CandidateSpan>();
+        candidates = new ArrayList<CandidateSpan>();
         hasMoreSpans = firstSpans.next();
     }
 
@@ -104,13 +107,33 @@
      */
     private List<CandidateSpan> collectAdjacentSpans () throws IOException {
 
-        CandidateSpan startSpan = new CandidateSpan(firstSpans);
+        CandidateSpan startSpan;
+        if (!candidates.isEmpty()) {
+            startSpan = candidates.get(0);
+            candidates.remove(0);
+        }
+        else {
+            startSpan = new CandidateSpan(firstSpans);
+        }
 
         List<CandidateSpan> adjacentSpans = new ArrayList<CandidateSpan>();
         adjacentSpans.add(startSpan);
 
         CandidateSpan prevSpan = startSpan;
 
+        int i = 0;
+        while (i < candidates.size()) {
+            CandidateSpan cs = candidates.get(i);
+            if (cs.getStart() > prevSpan.getEnd()) {
+                break;
+            }
+            else if (startSpan.getDoc() == cs.getDoc()
+                    && cs.getStart() == prevSpan.getEnd()) {
+                prevSpan = cs;
+                adjacentSpans.add(prevSpan);
+            }
+            i++;
+        }
         while ((hasMoreSpans = firstSpans.next())
                 && startSpan.getDoc() == firstSpans.doc()) {
 
@@ -124,17 +147,20 @@
             };
 
             if (firstSpans.start() > prevSpan.getEnd()) {
+                candidates.add(new CandidateSpan(firstSpans));
                 break;
             }
             else if (firstSpans.start() == prevSpan.getEnd()) {
                 prevSpan = new CandidateSpan(firstSpans);
                 adjacentSpans.add(prevSpan);
             }
+            else {
+                candidates.add(new CandidateSpan(firstSpans));
+            }
         }
         return adjacentSpans;
     }
 
-
     /**
      * Generates all possible repetition match spans from the given
      * list of
@@ -149,16 +175,17 @@
             int endIndex;
             while ((endIndex = j + i - 1) < adjacentSpans.size()) {
                 startSpan = adjacentSpans.get(j);
+                
                 if (i == 1) {
                     try {
-                        matchSpan = startSpan.clone();
-                        matchSpan.setPayloads(computeMatchPayload(
-                                adjacentSpans, 0, endIndex - 1));
-                        matchList.add(matchSpan);
+                         matchSpan = startSpan.clone();
+                         matchSpan.setPayloads(computeMatchPayload(
+                                 adjacentSpans, 0, endIndex - 1));
+                         matchList.add(matchSpan);
                     }
                     catch (CloneNotSupportedException e) {
-                        e.printStackTrace();
-                    }
+                            e.printStackTrace();
+                        }
                 }
                 else {
                     endSpan = adjacentSpans.get(endIndex);
@@ -172,8 +199,11 @@
                 }
                 j++;
             }
-        }
 
+            if (j + i == adjacentSpans.size()) {
+
+            }
+        }
         Collections.sort(matchList);
     }
 
@@ -251,6 +281,19 @@
 
     @Override
     public boolean skipTo (int target) throws IOException {
+        if (!candidates.isEmpty()) {
+            Iterator<CandidateSpan> i = candidates.iterator();
+            while (i.hasNext()) {
+                CandidateSpan cs = i.next();
+                if (cs.getDoc() < target) {
+                    i.remove();
+                }
+                else if (cs.getDoc() == target) {
+                    matchList.clear();
+                    return advance();
+                }
+            }
+        }
         if (hasMoreSpans && firstSpans.doc() < target) {
             if (!firstSpans.skipTo(target)) {
                 hasMoreSpans = false;
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
index b4ec124..c307e80 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -87,7 +87,7 @@
         	);
         }
         */
-        assertEquals((long) 495, kr.getTotalResults());
+        assertEquals((long) 5315, kr.getTotalResults());
         assertEquals(3, kr.getMatch(0).getStartPos());
         assertEquals(5, kr.getMatch(0).getEndPos());
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
index 2c4ca89..d8f79a7 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
@@ -3,7 +3,6 @@
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
-import java.util.ArrayList;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spans.SpanQuery;
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
index 8ce4a9e..7549b83 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
@@ -130,14 +130,13 @@
 
         SpanQuery sq;
         // c{2,2}
-        sq = new SpanRepetitionQuery(
-                new SpanTermQuery(new Term("base", "s:c")), 2, 2, true);
-        kr = ki.search(sq, (short) 10);
-        // doc1 2-4, 3-5, 4-6
-        assertEquals((long) 6, kr.getTotalResults());
+        // sq = new SpanRepetitionQuery(
+        // new SpanTermQuery(new Term("base", "s:c")), 2, 2, true);
+        // kr = ki.search(sq, (short) 10);
+        // // doc1 2-4, 3-5, 4-6
+        // assertEquals((long) 6, kr.getTotalResults());
 
         // ec{2,2}
-        kr = ki.search(sq, (short) 10);
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:e")),
                 new SpanRepetitionQuery(new SpanTermQuery(new Term("base",
                         "s:c")), 2, 2, true));
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
index 3750a18..f60d1be 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -349,22 +349,46 @@
         //   ){2,2}
         // )
 
+        kr = ki.search(query, (short) 20);
+        assertEquals(5, kr.getTotalResults());
+        assertEquals(0, kr.getMatch(0).getStartPos());
+        assertEquals(1, kr.getMatch(0).getEndPos());
+        assertEquals(2, kr.getMatch(1).getStartPos());
+        assertEquals(3, kr.getMatch(1).getEndPos());
+        assertEquals(3, kr.getMatch(2).getStartPos());
+        assertEquals(4, kr.getMatch(2).getEndPos());
+        assertEquals(5, kr.getMatch(3).getStartPos());
+        assertEquals(6, kr.getMatch(3).getEndPos());
+        assertEquals(9, kr.getMatch(4).getStartPos());
+        assertEquals(10, kr.getMatch(4).getEndPos());
+        
+        kr = ki.search(seq, (short) 20);
+        assertEquals(5, kr.getTotalResults());
+        assertEquals(0, kr.getMatch(0).getStartPos());
+        assertEquals(2, kr.getMatch(0).getEndPos());
+        assertEquals(2, kr.getMatch(1).getStartPos());
+        assertEquals(4, kr.getMatch(1).getEndPos());
+        assertEquals(3, kr.getMatch(2).getStartPos());
+        assertEquals(5, kr.getMatch(2).getEndPos());
+        assertEquals(5, kr.getMatch(3).getStartPos());
+        assertEquals(7, kr.getMatch(3).getEndPos());
+        assertEquals(9, kr.getMatch(4).getStartPos());
+        assertEquals(11, kr.getMatch(4).getEndPos());
+
         kr = ki.search(rep, (short) 20);
 
-        /*
-        for (Match km : kr.getMatches()){
-            System.out.println(
-                               km.getStartPos() +
-                               "," +
-                               km.getEndPos() +
-                               " " +
-                               km.getSnippetBrackets()
-                               );
-        };
-        */
+        // for (Match km : kr.getMatches()){
+        // System.out.println(
+        // km.getStartPos() +
+        // "," +
+        // km.getEndPos() +
+        // " " +
+        // km.getSnippetBrackets()
+        // );
+        // };
 
         assertEquals("[cecc]ecdeec", kr.getMatch(0).getSnippetBrackets());
-        // assertEquals("cec[cecd]eec", kr.getMatch(1).getSnippetBrackets());
+        assertEquals("cec[cecd]eec", kr.getMatch(1).getSnippetBrackets());
         assertEquals((long) 2, kr.getTotalResults());
     }
 
