diff --git a/public/js/demo/vc.html b/public/js/demo/vc.html
index c971dd7..372571c 100644
--- a/public/js/demo/vc.html
+++ b/public/js/demo/vc.html
@@ -73,8 +73,8 @@
       document.getElementById("json").innerHTML = JSON.stringify(vc.root().toJson());
     };
 
-    function showString() {
-      document.getElementById("string").innerHTML = vc.root().toString();
+    function showQuery() {
+      document.getElementById("query").innerHTML = vc.root().toQuery();
     };
 
     </script>
@@ -86,8 +86,8 @@
 
     <hr />
 
-    <p><a onclick="showString()" style="cursor:pointer">show String!</a></p>
-    <div id="string" class="info"></div>
+    <p><a onclick="showQuery()" style="cursor:pointer">show Query!</a></p>
+    <div id="query" class="info"></div>
 
   </body>
 </html>
diff --git a/public/js/spec/vcSpec.js b/public/js/spec/vcSpec.js
index 5f7d3ad..767f010 100644
--- a/public/js/spec/vcSpec.js
+++ b/public/js/spec/vcSpec.js
@@ -237,32 +237,32 @@
 
     // Empty doc
     var doc = KorAP.Doc.create();
-    expect(doc.toString()).toEqual("");
+    expect(doc.toQuery()).toEqual("");
 
     // Serialize string
     doc = stringFactory.create();
-    expect(doc.toString()).toEqual('author = "Max Birkendale"');
+    expect(doc.toQuery()).toEqual('author = "Max Birkendale"');
 
     // Serialize string with quotes
     doc = stringFactory.create({ "value" : 'Max "Der Coole" Birkendate'});
-    expect(doc.toString()).toEqual('author = "Max \\"Der Coole\\" Birkendate"');
+    expect(doc.toQuery()).toEqual('author = "Max \\"Der Coole\\" Birkendate"');
 
     // Serialize regex
     doc = regexFactory.create();
-    expect(doc.toString()).toEqual('title = /[^b]ee.+?/');
+    expect(doc.toQuery()).toEqual('title = /[^b]ee.+?/');
 
     doc = regexFactory.create({
       match: "match:ne"
     });
-    expect(doc.toString()).toEqual('title != /[^b]ee.+?/');
+    expect(doc.toQuery()).toEqual('title != /[^b]ee.+?/');
 
     doc = dateFactory.create();
-    expect(doc.toString()).toEqual('pubDate in 2014-11-05');
+    expect(doc.toQuery()).toEqual('pubDate in 2014-11-05');
 
     doc = dateFactory.create({
       value : "2014"
     });
-    expect(doc.toString()).toEqual('pubDate in 2014');
+    expect(doc.toQuery()).toEqual('pubDate in 2014');
   });
 });
 
@@ -411,7 +411,7 @@
 
   it('should be serializable to String', function () {
     var docGroup = docGroupFactory.create();
-    expect(docGroup.toString()).toEqual('author = "Max Birkendale" & pubDate in 2014-12-05');
+    expect(docGroup.toQuery()).toEqual('author = "Max Birkendale" & pubDate in 2014-12-05');
 
     docGroup = docGroupFactory.create({
       "@type" : "korap:docGroup",
@@ -453,7 +453,7 @@
 	}
       ]
     });
-    expect(docGroup.toString()).toEqual(
+    expect(docGroup.toQuery()).toEqual(
       'author = "Max Birkendale" | (pubDate since 2014-05-12 & pubDate until 2014-12-05 & foo != /[a]?bar/)'
     );
   });
@@ -463,10 +463,10 @@
   it('should be initializable', function () {
     var doc = KorAP.UnspecifiedDoc.create();
     var docElement = doc.element();
-    expect(docElement.getAttribute('class')).toEqual('unspecified');
+    expect(docElement.getAttribute('class')).toEqual('doc unspecified');
     expect(docElement.firstChild.firstChild.data).toEqual('⋯');
     expect(docElement.lastChild.getAttribute('class')).toEqual('operators');
-    expect(doc.toString()).toEqual('⋯');
+    expect(doc.toQuery()).toEqual('⋯');
 
     // Only removable
     expect(docElement.lastChild.children.length).toEqual(0);
@@ -492,7 +492,7 @@
     expect(docGroup.element().children[0].getAttribute('class')).toEqual('doc');
 
     var unspec = docGroup.element().children[1];
-    expect(unspec.getAttribute('class')).toEqual('unspecified');
+    expect(unspec.getAttribute('class')).toEqual('doc unspecified');
 
     // Removable
     expect(unspec.lastChild.children.length).toEqual(1);
@@ -781,7 +781,7 @@
   it('should be initializable', function () {
     var vc = KorAP.VirtualCollection.render();
     expect(vc.element().getAttribute('class')).toEqual('vc');
-    expect(vc.root().element().getAttribute('class')).toEqual('unspecified');
+    expect(vc.root().element().getAttribute('class')).toEqual('doc unspecified');
 
     // Not removable
     expect(vc.root().element().lastChild.children.length).toEqual(0);
@@ -882,7 +882,7 @@
   it('should be modifiable by deletion in nested docGroups (root case)', function () {
     var vc = nestedGroupFactory.create();
 
-    expect(vc.toString()).toEqual(
+    expect(vc.toQuery()).toEqual(
       'author = "Max Birkendale" | (pubDate since 2014-05-12 & pubDate until 2014-12-05)'
     );
 
@@ -920,7 +920,7 @@
     expect(vc.root().operation()).toEqual("and");
     expect(vc.root().getOperand(0).ldType()).toEqual("doc");
 
-    expect(vc.toString()).toEqual(
+    expect(vc.toQuery()).toEqual(
       'pubDate since 2014-05-12 & pubDate until 2014-12-05'
     );
   });
@@ -961,7 +961,7 @@
     
     // Structur is now:
     // or(doc, and(doc, doc, or(doc, doc)))
-    expect(vc.toString()).toEqual(
+    expect(vc.toQuery()).toEqual(
       'author = "Max Birkendale" | (pubDate since 2014-05-12 & pubDate until 2014-12-05 & (title = "Der Birnbaum" | pubDate in 2014-12-05))'
     );
 
@@ -980,8 +980,10 @@
     // Structur is now:
     // or(doc, and(doc, or(doc, doc)))
 
-    expect(vc.toString()).toEqual(
-      'author = "Max Birkendale" | (pubDate since 2014-05-12 & (title = "Der Birnbaum" | pubDate in 2014-12-05))'
+    expect(vc.toQuery()).toEqual(
+      'author = "Max Birkendale"' +
+	' | (pubDate since 2014-05-12 & ' +
+	'(title = "Der Birnbaum" | pubDate in 2014-12-05))'
     );
 
 
@@ -990,7 +992,7 @@
     // Structur is now:
     // or(doc, doc, doc)
 
-    expect(vc.toString()).toEqual(
+    expect(vc.toQuery()).toEqual(
       'author = "Max Birkendale" | title = "Der Birnbaum" | pubDate in 2014-12-05'
     );
   });
@@ -998,25 +1000,26 @@
   it('should be reducible to unspecification', function () {
     var vc = demoFactory.create();
 
-    expect(vc.toString()).toEqual(vc.root().toString());
+    expect(vc.toQuery()).toEqual(vc.root().toQuery());
 
-    expect(vc.toString()).toEqual('(Titel = "Baum" & Veröffentlichungsort = "hihi" & (Titel = "Baum" | Veröffentlichungsort = "hihi")) | Untertitel = "huhu"');
+    expect(vc.toQuery()).toEqual(
+      '(Titel = "Baum" & Veröffentlichungsort = "hihi" & ' +
+	'(Titel = "Baum" | Veröffentlichungsort = "hihi")) ' +
+	'| Untertitel = "huhu"');
 
     expect(vc.root().element().lastChild.children[0].firstChild.nodeValue).toEqual('and');
     expect(vc.root().element().lastChild.children[1].firstChild.nodeValue).toEqual('×');
-
     expect(vc.root().delOperand(vc.root().getOperand(0)).update()).not.toBeUndefined();
+    expect(vc.toQuery()).toEqual('Untertitel = "huhu"');
 
-    expect(vc.toString()).toEqual('Untertitel = "huhu"');
-
-    expect(vc.root().element().lastChild.children[0].firstChild.nodeValue).toEqual('and');
-    expect(vc.root().element().lastChild.children[1].firstChild.nodeValue).toEqual('or');
-    expect(vc.root().element().lastChild.children[2].firstChild.nodeValue).toEqual('×');
+    var lc = vc.root().element().lastChild;
+    expect(lc.children[0].firstChild.nodeValue).toEqual('and');
+    expect(lc.children[1].firstChild.nodeValue).toEqual('or');
+    expect(lc.children[2].firstChild.nodeValue).toEqual('×');
 
     // Clean everything
     vc.clean();
-    expect(vc.toString()).toEqual('⋯');    
-
+    expect(vc.toQuery()).toEqual('⋯');
   });
 });
 
diff --git a/public/js/src/vc.js b/public/js/src/vc.js
index 290531a..52bf129 100644
--- a/public/js/src/vc.js
+++ b/public/js/src/vc.js
@@ -5,7 +5,7 @@
 // TODO: Implement "toQuery"
 
 /*
- * Error codes:
+  Error codes:
   701: "JSON-LD group has no @type attribute" 
   704: "Operation needs operand list"
   802: "Match type is not supported by value type"
@@ -40,10 +40,12 @@
   loc.DEL   = loc.DEL   || '×';
   loc.EMPTY = loc.EMPTY || '⋯'
 
+
   function _bool (bool) {
     return (bool === undefined || bool === false) ? false : true;
   };
 
+
   function _removeChildren (node) {
     // Remove everything underneath
     while (node.firstChild)
@@ -60,8 +62,15 @@
   // Add 'and'-criterion
   KorAP._and = function (e) {
     var obj = this.parentNode.refTo;
+    if (obj.ldType() === 'docGroup') {
+      console.log('~~~~~~~~~');
+    }
+    else if (obj.ldType() === 'doc') {
+      obj.parent().newAfter(obj);
+    };
   };
 
+
   // Remove doc or docGroup
   KorAP._delete = function (e) {
     var obj = this.parentNode.refTo;
@@ -71,13 +80,19 @@
       obj.parent().clean();
   };
 
+
+  /**
+   * Virtual Collection
+   */
   KorAP.VirtualCollection = {
     ldType : function () {
       return null;
     },
+
     create : function () {
       return Object.create(KorAP.VirtualCollection);
     },
+
     clean : function () {
       if (this._root.ldType() !== "non") {
 	this._root.destroy();
@@ -85,6 +100,7 @@
       };
       return this;
     },
+
     render : function (json) {
       var obj = Object.create(KorAP.VirtualCollection);
 
@@ -112,6 +128,7 @@
 
       return obj;
     },
+
     root : function (obj) {
       if (arguments.length === 1) {
 	var e = this.element();
@@ -146,17 +163,22 @@
 
       return this._element;
     },
+
+    update : function () {
+      this._root.update();
+      return this;
+    },
+
     toJson : function () {
       return this._root.toJson();
     },
-    toString : function () {
-      return this._root.toString();
-    },
-    update : function () {
-      this._root.update();
+
+    toQuery : function () {
+      return this._root.toQuery();
     }
   };
 
+
   /**
    * Operators for criteria
    */
@@ -168,6 +190,7 @@
       op.del(del);
       return op;
     },
+
     update : function () {
       // Init the element
       if (this._element === undefined)
@@ -232,16 +255,19 @@
       this.update();
       return this._element;
     },
+
     and : function (bool) {
       if (arguments.length === 1)
 	this._and = _bool(bool);
       return this._and;
     },
+
     or : function (bool) {
       if (arguments.length === 1)
 	this._or = _bool(bool);
       return this._or;
     },
+
     del : function (bool) {
       if (arguments.length === 1)
 	this._del = _bool(bool);
@@ -264,6 +290,7 @@
 
       return obj;
     },
+
     update : function () {
 
       if (this._element === undefined)
@@ -291,13 +318,12 @@
 
       return this.element();
     },
+
     element : function () {
       if (this._element !== undefined)
 	return this._element;
-
       this._element = document.createElement('div');
-      this._element.setAttribute('class', 'unspecified');
-
+      this._element.setAttribute('class', 'doc unspecified');
       this.update();
       return this._element;
     }
@@ -305,7 +331,7 @@
 
 
   /**
-   * Virtual collection doc criterion.
+   * Document criterion
    */
   KorAP.Doc = {
     _ldType : "doc",
@@ -410,6 +436,7 @@
       return div;
 */
     },
+
     // Deserialize from json
     fromJson : function (json) {
       if (json === undefined)
@@ -512,6 +539,7 @@
 
       return this;
     },
+
     key : function (value) {
       if (arguments.length === 1) {
 	this._key = value;
@@ -519,6 +547,7 @@
       };
       return this._key;
     },
+
     matchop : function (match) {
       if (arguments.length === 1) {
 	this._matchop = match.replace(/^match:/, '');
@@ -526,6 +555,7 @@
       };
       return this._matchop || "eq";
     },
+
     type : function (type) {
       if (arguments.length === 1) {
 	this._type = type;
@@ -533,6 +563,7 @@
       };
       return this._type || "string";
     },
+
     value : function (value) {
       if (arguments.length === 1) {
 	this._value = value;
@@ -540,6 +571,7 @@
       };
       return this._value;
     },
+
     toJson : function () {
       if (!this.matchop() || !this.key())
 	return {};
@@ -552,7 +584,8 @@
 	"type"  : "type:" + this.type()
       };
     },
-    toString : function () {
+
+    toQuery : function () {
       if (!this.matchop() || !this.key())
 	return "";
 
@@ -593,12 +626,13 @@
 	break;
       };
 
-      return "...";
+      return "";
     }
   };
 
+
   /**
-   * Virtual collection group criterion.
+   * Document group criterion
    */
   KorAP.DocGroup = {
     _ldType : "docGroup",
@@ -611,6 +645,17 @@
 	obj._parent = parent;
       return obj;
     },
+
+    newAfter : function (obj) {
+      for (var i in this._operands) {
+	if (this._operands[i] === obj) {
+	  var operand = KorAP.UnspecifiedDoc.create(this);
+	  this._operands.splice(i + 1, 0, operand);
+	  return this.update();
+	};
+      };
+    },
+
     append : function (operand) {
 
       // Append unspecified object
@@ -660,6 +705,7 @@
 	return;
       };
     },
+
     update : function () {
       // There is only one operand in group
       if (this._operands.length === 1) {
@@ -713,6 +759,7 @@
 
       return this;
     },
+
     element : function () {
       if (this._element !== undefined)
 	return this._element;
@@ -725,6 +772,7 @@
 
       return this._element;
     },
+
     operation : function (op) {
       if (arguments.length === 1) {
 	if (KorAP._validGroupOpRE.test(op)) {
@@ -737,9 +785,11 @@
       };
       return this._op || 'and';
     },
+
     operands : function () {
       return this._operands;
     },
+
     getOperand : function (index) {
       return this._operands[index];
     },
@@ -836,6 +886,7 @@
     
       return this;
     },
+
     toJson : function () {
       var opArray = new Array();
       for (var i in this._operands) {
@@ -847,17 +898,21 @@
 	"operands"  : opArray
       };
     },
-    toString : function () {
+
+    toQuery : function () {
       return this._operands.
 	map(function (op) {
-	  return op.ldType() === 'docGroup' ? '(' + op.toString() + ')' : op.toString()
-	}).
-	join(this.operation() === 'or' ? ' | ' : ' & ')
+	  return (op.ldType() === 'docGroup') ?
+	    '(' + op.toQuery() + ')' :
+	    op.toQuery();
+	}).join(this.operation() === 'or' ? ' | ' : ' & ')
     }
   };
 
 
-  // Abstract JsonLD object
+  /**
+   * Abstract JsonLD criterion object
+   */
   KorAP.JsonLD = {
     _changed : false,
 
@@ -928,7 +983,8 @@
 	"@type" : "korap:" + this.ldType()
       };
     },
-    toString : function () {
+
+    toQuery : function () {
       return loc.EMPTY;
     }
   };
