Boundary support for distances
diff --git a/CHANGES b/CHANGES
index 0bc6f4c..c34fea9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,12 @@
-0.31.8 2014-07-23
+0.31.8 2014-07-24
         - [feature] Added optionality to querys for quantifiers (diewald)
+        - [feature] Support for korap:boundary deserialization (diewald)
 
 0.31.7 2014-07-18
         - [feature] Added warnings to responses (diewald)
 
 0.31.6 2014-06-30
-        - [feature] support for korap:reference deserialization (diewald)
+        - [feature] Support for korap:reference deserialization (diewald)
 	- [feature] Preliminary support for attributes in elements (margaretha)
 	- [feature] Preliminary support operation:repetition deserialization
 	  (unfinished and untested; diewald)
diff --git a/src/main/java/de/ids_mannheim/korap/KorapQuery.java b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
index e0f0e67..a80a675 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
@@ -254,11 +254,18 @@
 			if (constraint.has("key"))
 			    unit = constraint.get("key").asText();
 
-			sseqqw.withConstraint(
-		            constraint.get("min").asInt(1),
-			    constraint.get("max").asInt(1),
-			    unit
-			);
+			int min, max;
+			if (constraint.has("boundary")) {
+			    Boundary b = new Boundary(constraint.get("boundary"), 1,1);
+			    min = b.min;
+			    max = b.max;
+			}
+			else {
+			    min = constraint.get("min").asInt(1);
+			    max = constraint.get("max").asInt(1);
+			};
+
+			sseqqw.withConstraint(min, max, unit);
 		    };
 		};