diff --git a/public/js/demo/vc.html b/public/js/demo/vc.html
index 6c306b0..d4924e4 100644
--- a/public/js/demo/vc.html
+++ b/public/js/demo/vc.html
@@ -29,6 +29,24 @@
               "key":"Veröffentlichungsort",
               "value":"hihi",
               "match":"match:eq"
+            },
+            {
+              "@type":"korap:docGroup",
+              "operation":"operation:or",
+              "operands":[
+                {
+                  "@type":"korap:doc",
+                  "key":"Titel",
+                  "value":"Baum",
+                  "match":"match:eq"
+                },
+                {
+                  "@type":"korap:doc",
+                  "key":"Veröffentlichungsort",
+                  "value":"hihi",
+                  "match":"match:eq"
+                }
+              ]
             }
           ]
         },
diff --git a/public/js/spec/vcSpec.js b/public/js/spec/vcSpec.js
index ce2ca4a..2010adf 100644
--- a/public/js/spec/vcSpec.js
+++ b/public/js/spec/vcSpec.js
@@ -631,7 +631,46 @@
   it('should be based on a nested docGroup', function () {
     var vc = KorAP.VirtualCollection.render({
       "@type" : "korap:docGroup",
-      "operation" : "operation:or",
+      "operation" : "operation:and",
+      "operands" : [
+	{
+	  "@type": 'korap:doc',
+	  "key": 'pubDate',
+	  "match": 'match:geq',
+	  "value": '2014-05-12',
+	  "type": 'type:date'
+	},
+	{
+	  "@type": 'korap:doc',
+	  "key": 'pubDate',
+	  "match": 'match:leq',
+	  "value": '2014-12-05',
+	  "type": 'type:date'
+	},
+	{
+	  "@type": 'korap:doc',
+	  "key": 'foo',
+	  "match": 'match:eq',
+	  "value": 'bar',
+	  "type": 'type:string'
+	}
+      ]
+    });
+
+    var docGroup = vc.root();
+    var doc = docGroup.getOperand(1);
+    expect(doc.key()).toEqual("pubDate");
+    expect(docGroup.delOperand(doc)).toEqual(true);
+    doc = docGroup.getOperand(1);
+    expect(doc.key()).toEqual("foo");
+  });    
+
+  it('should be modifiable', function () {
+    var vc = KorAP.VirtualCollection.render();
+
+    var vc = KorAP.VirtualCollection.render({
+      "@type" : "korap:docGroup",
+      "operation" : "operation:and",
       "operands" : [
 	{
 	  "@type": 'korap:doc',
@@ -641,37 +680,19 @@
 	  "type": 'type:string'
 	},
 	{
-	  "@type" : "korap:docGroup",
-	  "operation" : "operation:and",
-	  "operands" : [
-	    {
-	      "@type": 'korap:doc',
-	      "key": 'pubDate',
-	      "match": 'match:geq',
-	      "value": '2014-05-12',
-	      "type": 'type:date'
-	    },
-	    {
-	      "@type": 'korap:doc',
-	      "key": 'pubDate',
-	      "match": 'match:leq',
-	      "value": '2014-12-05',
-	      "type": 'type:date'
-	    }
-	  ]
+	  "@type": 'korap:doc',
+	  "key": 'pubDate',
+	  "match": 'match:eq',
+	  "value": '2014-12-05',
+	  "type": 'type:date'
 	}
       ]
     });
+
     expect(vc.element().getAttribute('class')).toEqual('vc');
-    expect(vc.element().firstChild.getAttribute('class')).toEqual('docGroup');
-    expect(vc.element().firstChild.children[0].getAttribute('class')).toEqual('doc');
-    var dg = vc.element().firstChild.children[1];
-    expect(dg.getAttribute('class')).toEqual('docGroup');
-    expect(dg.children[0].getAttribute('class')).toEqual('doc');
-    expect(dg.children[1].getAttribute('class')).toEqual('doc');
-    expect(dg.children[2].getAttribute('class')).toEqual('operators');
-    expect(vc.element().firstChild.children[2].getAttribute('class')).toEqual('operators');
-  });    
+    expect(vc.root().element().getAttribute('class')).toEqual('docGroup');
+    expect(vc.root().operation()).toEqual('and');
+  });
 });
 
 describe('KorAP.Operators', function () {
diff --git a/public/js/src/vc.js b/public/js/src/vc.js
index fe702a7..fbdc118 100644
--- a/public/js/src/vc.js
+++ b/public/js/src/vc.js
@@ -96,6 +96,20 @@
     }
   };
 
+  KorAP._or = function (e) {
+    var obj = this.parentNode.refTo;
+  };
+
+  KorAP._and = function (e) {
+    var obj = this.parentNode.refTo;
+  };
+
+  KorAP._delete = function (e) {
+    var obj = this.parentNode.refTo;
+    obj.parent().delOperand(obj);
+    // Todo: CLEAR ALL THE THINGS!
+  };
+
   /**
    * Operators for criteria
    */
@@ -115,6 +129,8 @@
 
       var op = this._element;
 
+      op.refTo = this.parent();
+
       // Remove everything underneath
       _removeChildren(op);
 
@@ -122,6 +138,7 @@
       if (this._and === true) {
 	var andE = document.createElement('span');
 	andE.setAttribute('class', 'and');
+	andE.addEventListener('click', KorAP._and, false);
 	andE.appendChild(document.createTextNode(KorAP.Locale.AND));
 	op.appendChild(andE);
       };
@@ -130,6 +147,7 @@
       if (this._or === true) {
 	var orE = document.createElement('span');
 	orE.setAttribute('class', 'or');
+	orE.addEventListener('click', KorAP._or, false);
 	orE.appendChild(document.createTextNode(KorAP.Locale.OR));
 	op.appendChild(orE);
       };
@@ -139,11 +157,19 @@
 	var delE = document.createElement('span');
 	delE.setAttribute('class', 'delete');
 	delE.appendChild(document.createTextNode(KorAP.Locale.DEL));
+	delE.addEventListener('click', KorAP._delete, false);
 	op.appendChild(delE);
       };
 
       return op;
     },
+
+    // Be aware! This may be cyclic
+    parent : function (obj) {
+      if (arguments.length === 1)
+	this._parent = obj;
+      return this._parent;
+    },
     element : function () {
 
       // Return existing element
@@ -208,7 +234,6 @@
 	op.element()
       );
 
-
       return this.element();
     },
     element : function () {
@@ -564,6 +589,21 @@
       return this._operands[index];
     },
 
+    // Delete operand from group
+    delOperand : function (obj) {
+      for (var i in this._operands) {
+	if (this._operands[i] === obj) {
+	  this._operands.splice(i,1);
+
+	  // Todo: Update has to check
+	  // that this may mean the group is empty etc.
+	  this.update();
+	  return true;
+	};
+      };
+      return false;
+    },
+
     // Deserialize from json
     fromJson : function (json) {
       if (json === undefined)
@@ -638,12 +678,15 @@
 	this._parent = obj;
       return this._parent;
     },
+
+    // Be aware! This may be cyclic
     operators : function (and, or, del) {
       if (arguments === 0)
 	return this._ops;
       this._ops = KorAP.Operators.create(
 	and, or, del
       );
+      this._ops.parent(this);
       return this._ops;
     },
     toJson : function () {
