diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
index 4ad6a01..0a348fa 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
@@ -64,6 +64,7 @@
 		requestMap.put("warnings", warnings);
 		requestMap.put("announcements", announcements);
 		requestMap.put("collection", collection);
+		requestMap.put("meta", new LinkedHashMap<String, Object>());
 	}
 	
 	public Map<String, Object> getRequestMap() {
@@ -267,7 +268,11 @@
 
 	protected LinkedHashMap<String, Object> makeDistance(String key, Integer min, Integer max) {
 		LinkedHashMap<String, Object> group = new LinkedHashMap<String, Object>();
-		group.put("@type", "korap:distance");
+		if (key.equals("w")) {
+			group.put("@type", "korap:distance");
+		} else {
+			group.put("@type", "cosmas:distance");
+		}
 		group.put("key", key);
 		group.put("boundary", makeBoundary(min, max));
 		group.put("min", min);
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
index c89f418..f8a7f19 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
@@ -28,275 +28,256 @@
  */
 public class CosmasTree extends Antlr3AbstractSyntaxTree {
 
-    private static Logger log = LoggerFactory.getLogger(CosmasTree.class);
+	private static Logger log = LoggerFactory.getLogger(CosmasTree.class);
 
-    LinkedList<LinkedHashMap[]> toWrapStack = new LinkedList<LinkedHashMap[]>();
-    /**
-     * Field for repetition query (Kleene + or * operations, or min/max queries: {2,4}
-     */
-    String repetition = "";
-    /**
-     * Global control structure for fieldGroups, keeps track of open fieldGroups.
-     */
-    LinkedList<ArrayList<Object>> openFieldGroups = new LinkedList<ArrayList<Object>>();
-    /**
-     * Keeps track of how many toWrap objects there are to pop after every recursion of {@link #processNode(ParseTree)}
-     */
-    LinkedList<Integer> toWrapsToPop = new LinkedList<Integer>();
-    /**
-     * Flag that indicates whether token fields or meta fields are currently being processed
-     */
-    boolean inMeta = false;
-    /**
-     * If true, a sequence (OPPROX node) is governed by an OPALL node (ALL()-operator), which requires to match
-     * all tokens of the sequence.
-     */
-    boolean inOPALL = false;
-    boolean inOPNHIT = false;
-    /**
-     *
-     */
-    int classCounter = 1;
-    boolean negate = false;
+	LinkedList<LinkedHashMap[]> toWrapStack = new LinkedList<LinkedHashMap[]>();
+	/**
+	 * Field for repetition query (Kleene + or * operations, or min/max queries: {2,4}
+	 */
+	String repetition = "";
+	/**
+	 * Global control structure for fieldGroups, keeps track of open fieldGroups.
+	 */
+	LinkedList<ArrayList<Object>> openFieldGroups = new LinkedList<ArrayList<Object>>();
+	/**
+	 * Keeps track of how many toWrap objects there are to pop after every recursion of {@link #processNode(ParseTree)}
+	 */
+	LinkedList<Integer> toWrapsToPop = new LinkedList<Integer>();
+	/**
+	 * Flag that indicates whether token fields or meta fields are currently being processed
+	 */
+	boolean inMeta = false;
+	/**
+	 * If true, a sequence (OPPROX node) is governed by an OPALL node (ALL()-operator), which requires to match
+	 * all tokens of the sequence.
+	 */
+	boolean inOPALL = false;
+	boolean inOPNHIT = false;
+	/**
+	 *
+	 */
+	int classCounter = 1;
+	boolean negate = false;
 
-    /**
-     * Allows for the definition of objects to be wrapped around the arguments of an operation.
-     * Each record in the table holds the parent node of the argument, the number of the argument 
-     * and an object in whose operands list the argument shall be wrapped.
-     */
-    Table<Tree,Integer,LinkedHashMap<String,Object>> operandWrap = HashBasedTable.create();
+	/**
+	 * Allows for the definition of objects to be wrapped around the arguments of an operation.
+	 * Each record in the table holds the parent node of the argument, the number of the argument 
+	 * and an object in whose operands list the argument shall be wrapped.
+	 */
+	Table<Tree,Integer,LinkedHashMap<String,Object>> operandWrap = HashBasedTable.create();
 
-    /**
-     * Keeps track of all visited nodes in a tree
-     */
-    List<Tree> visited = new ArrayList<Tree>();
+	/**
+	 * Keeps track of all visited nodes in a tree
+	 */
+	List<Tree> visited = new ArrayList<Tree>();
 
-    Integer stackedToWrap = 0;
-    /**
-     * A list of node categories that can be sequenced (i.e. which can be in a sequence with any number of other nodes in this list)
-     */
-    private final List<String> sequentiableCats = Arrays.asList(new String[]{"OPWF", "OPLEM", "OPMORPH", "OPBEG", "OPEND", "OPIN", "OPBED"});
-    /**
-     * Keeps track of sequenced nodes, i.e. nodes that implicitly govern  a sequence, as in (C2PQ (OPWF der) (OPWF Mann)).
-     * This is necessary in order to know when to take the sequence off the object stack, as the sequence is introduced by the
-     * first child but cannot be closed after this first child in order not to lose its siblings
-     */
-    private LinkedList<Tree> sequencedNodes = new LinkedList<Tree>();
+	Integer stackedToWrap = 0;
+	/**
+	 * A list of node categories that can be sequenced (i.e. which can be in a sequence with any number of other nodes in this list)
+	 */
+	private final List<String> sequentiableCats = Arrays.asList(new String[]{"OPWF", "OPLEM", "OPMORPH", "OPBEG", "OPEND", "OPIN", "OPBED"});
+	/**
+	 * Keeps track of sequenced nodes, i.e. nodes that implicitly govern  a sequence, as in (C2PQ (OPWF der) (OPWF Mann)).
+	 * This is necessary in order to know when to take the sequence off the object stack, as the sequence is introduced by the
+	 * first child but cannot be closed after this first child in order not to lose its siblings
+	 */
+	private LinkedList<Tree> sequencedNodes = new LinkedList<Tree>();
 
-    private boolean nodeHasSequentiableSiblings;
+	private boolean nodeHasSequentiableSiblings;
 
-    /**
-     * Keeps track of operands lists that are to be serialised in an inverted
-     * order (e.g. the IN() operator) compared to their AST representation.
-     */
-    private LinkedList<ArrayList<Object>> invertedOperandsLists = new LinkedList<ArrayList<Object>>();
-    /**
-     * @param tree   The syntax tree as returned by ANTLR
-     * @param parser The ANTLR parser instance that generated the parse tree
-     * @throws QueryException
-     */
-    public CosmasTree(String query) throws QueryException {
-        this.query = query;
-        process(query);
-        log.info(">>> " + requestMap.get("query") + " <<<");
-    }
+	/**
+	 * Keeps track of operands lists that are to be serialised in an inverted
+	 * order (e.g. the IN() operator) compared to their AST representation.
+	 */
+	private LinkedList<ArrayList<Object>> invertedOperandsLists = new LinkedList<ArrayList<Object>>();
+	/**
+	 * @param tree   The syntax tree as returned by ANTLR
+	 * @param parser The ANTLR parser instance that generated the parse tree
+	 * @throws QueryException
+	 */
+	public CosmasTree(String query) throws QueryException {
+		this.query = query;
+		process(query);
+		log.info(">>> " + requestMap.get("query") + " <<<");
+	}
 
-    @Override
-    public void process(String query) throws QueryException {
-        Tree tree = null;
-        try {
-            tree = parseCosmasQuery(query);
-        } catch (RecognitionException e) {
-            throw new QueryException("Your query could not be processed. Please make sure it is well-formed.");
-        } catch (NullPointerException e) {
-            throw new QueryException("Your query could not be processed. Please make sure it is well-formed.");
-        }
-        log.info("Processing CosmasII query");
-        System.out.println("Processing Cosmas");
-        processNode(tree);
-        log.info(requestMap.toString());
-    }
+	@Override
+	public void process(String query) throws QueryException {
+		Tree tree = null;
+		try {
+			tree = parseCosmasQuery(query);
+		} catch (RecognitionException e) {
+			throw new QueryException("Your query could not be processed. Please make sure it is well-formed.");
+		} catch (NullPointerException e) {
+			throw new QueryException("Your query could not be processed. Please make sure it is well-formed.");
+		}
+		log.info("Processing CosmasII query");
+		System.out.println("Processing Cosmas");
+		processNode(tree);
+		log.info(requestMap.toString());
+	}
 
-    @SuppressWarnings("unchecked")
-    private void processNode(Tree node) {
+	@SuppressWarnings("unchecked")
+	private void processNode(Tree node) {
 
-        // Top-down processing
-        if (visited.contains(node)) return;
-        else visited.add(node);
+		// Top-down processing
+		if (visited.contains(node)) return;
+		else visited.add(node);
 
 
-        String nodeCat = getNodeCat(node);
-        openNodeCats.push(nodeCat);
+		String nodeCat = getNodeCat(node);
+		openNodeCats.push(nodeCat);
 
-        stackedObjects = 0;
-        stackedToWrap = 0;
+		stackedObjects = 0;
+		stackedToWrap = 0;
 
-        if (verbose) {
-            System.err.println(" " + objectStack);
-            System.out.println(openNodeCats);
-        }
+		if (verbose) {
+			System.err.println(" " + objectStack);
+			System.out.println(openNodeCats);
+		}
 
-		
+
 		/* ***************************************
-         * Processing individual node categories *
+		 * Processing individual node categories *
 		 *****************************************/
 
 
-        // Check for potential implicit sequences as in (C2PQ (OPWF der) (OPWF Mann)). The sequence is introduced
-        // by the first child if it (and its siblings) is sequentiable.
-        if (sequentiableCats.contains(nodeCat)) {
-            // for each node, check if parent has more than one child (-> could be implicit sequence)
-            Tree parent = node.getParent();
-            if (parent.getChildCount() > 1) {
-                // if node is first child of parent...
-                if (node == parent.getChild(0)) {
-                    nodeHasSequentiableSiblings = false;
-                    for (int i = 1; i < parent.getChildCount(); i++) {
-                        if (sequentiableCats.contains(getNodeCat(parent.getChild(i)))) {
-                            nodeHasSequentiableSiblings = true;
-                            continue;
-                        }
-                    }
-                    if (nodeHasSequentiableSiblings) {
-                        // Step I: create sequence
-                        LinkedHashMap<String, Object> sequence = new LinkedHashMap<String, Object>();
-                        sequence.put("@type", "korap:group");
-                        sequence.put("operation", "operation:sequence");
-                        sequence.put("operands", new ArrayList<Object>());
-                        // push sequence on object stack but don't increment stackedObjects counter since
-                        // we've got to wait until the parent node is processed - therefore, add the parent
-                        // to the sequencedNodes list and remove the sequence from the stack when the parent
-                        // has been processed
-                        objectStack.push(sequence);
-                        sequencedNodes.push(parent);
-                        // Step II: decide where to put sequence
-                        putIntoSuperObject(sequence, 1);
-                    }
-                }
-            }
-        }
+		// Check for potential implicit sequences as in (C2PQ (OPWF der) (OPWF Mann)). The sequence is introduced
+		// by the first child if it (and its siblings) is sequentiable.
+		if (sequentiableCats.contains(nodeCat)) {
+			// for each node, check if parent has more than one child (-> could be implicit sequence)
+			Tree parent = node.getParent();
+			if (parent.getChildCount() > 1) {
+				// if node is first child of parent...
+				if (node == parent.getChild(0)) {
+					nodeHasSequentiableSiblings = false;
+					for (int i = 1; i < parent.getChildCount(); i++) {
+						if (sequentiableCats.contains(getNodeCat(parent.getChild(i)))) {
+							nodeHasSequentiableSiblings = true;
+							continue;
+						}
+					}
+					if (nodeHasSequentiableSiblings) {
+						// Step I: create sequence
+						LinkedHashMap<String, Object> sequence = new LinkedHashMap<String, Object>();
+					sequence.put("@type", "korap:group");
+					sequence.put("operation", "operation:sequence");
+					sequence.put("operands", new ArrayList<Object>());
+					// push sequence on object stack but don't increment stackedObjects counter since
+					// we've got to wait until the parent node is processed - therefore, add the parent
+					// to the sequencedNodes list and remove the sequence from the stack when the parent
+					// has been processed
+					objectStack.push(sequence);
+					sequencedNodes.push(parent);
+					// Step II: decide where to put sequence
+					putIntoSuperObject(sequence, 1);
+					}
+				}
+			}
+		}
 
-        // Nodes introducing tokens. Process all in the same manner, except for the fieldMap entry
-        if (nodeCat.equals("OPWF") || nodeCat.equals("OPLEM")) {
+		// Nodes introducing tokens. Process all in the same manner, except for the fieldMap entry
+		if (nodeCat.equals("OPWF") || nodeCat.equals("OPLEM")) {
 
-            //Step I: get info
-            LinkedHashMap<String, Object> token = new LinkedHashMap<String, Object>();
-            token.put("@type", "korap:token");
-            objectStack.push(token);
-            stackedObjects++;
-            LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
-            token.put("wrap", fieldMap);
+			//Step I: get info
+			LinkedHashMap<String, Object> token = new LinkedHashMap<String, Object>();
+			token.put("@type", "korap:token");
+			objectStack.push(token);
+			stackedObjects++;
+			LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
+			token.put("wrap", fieldMap);
 
-            fieldMap.put("@type", "korap:term");
-            // make category-specific fieldMap entry
-            String attr = nodeCat.equals("OPWF") ? "orth" : "lemma";
-            String value = node.getChild(0).toStringTree().replaceAll("\"", "");
-            // check for wildcard string
-            Pattern p = Pattern.compile("[+*?]");
-            Matcher m = p.matcher(value);
-            if (m.find()) fieldMap.put("type", "type:wildcard");
-            
-            if (value.startsWith("$")) {
-                value = value.substring(1);
-                fieldMap.put("caseInsensitive", true);
-            }
+			fieldMap.put("@type", "korap:term");
+			// make category-specific fieldMap entry
+			String attr = nodeCat.equals("OPWF") ? "orth" : "lemma";
+			String value = node.getChild(0).toStringTree().replaceAll("\"", "");
+			// check for wildcard string
+			Pattern p = Pattern.compile("[+*?]");
+			Matcher m = p.matcher(value);
+			if (m.find()) fieldMap.put("type", "type:wildcard");
 
-            fieldMap.put("key", value);
-            fieldMap.put("layer", attr);
+			if (value.startsWith("$")) {
+				value = value.substring(1);
+				fieldMap.put("caseInsensitive", true);
+			}
 
-            // negate field (see above)
-            if (negate) {
-                fieldMap.put("match", "match:ne");
-            } else {
-                fieldMap.put("match", "match:eq");
-            }
-            //Step II: decide where to put
-            if (!hasChild(node, "TPOS")) {
-                putIntoSuperObject(token, 1);
-                visited.add(node.getChild(0));
-            } else {
-            	// TODO
-            }
-        }
+			fieldMap.put("key", value);
+			fieldMap.put("layer", attr);
 
-        if (nodeCat.equals("OPMORPH")) {
-            //Step I: get info
-            LinkedHashMap<String, Object> token = new LinkedHashMap<String, Object>();
-            token.put("@type", "korap:token");
-            LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
-            token.put("wrap", fieldMap);
+			// negate field (see above)
+			if (negate) {
+				fieldMap.put("match", "match:ne");
+			} else {
+				fieldMap.put("match", "match:eq");
+			}
+			//Step II: decide where to put
+			if (!hasChild(node, "TPOS")) {
+				putIntoSuperObject(token, 1);
+				visited.add(node.getChild(0));
+			} else {
+				// TODO
+			}
+		}
 
-            fieldMap.put("@type", "korap:term");
-//			fieldMap.put("key", "morph:"+node.getChild(0).toString().replace(" ", "_"));
-            String[] morphValues = node.getChild(0).toString().split(" ");
-            String pos = morphValues[0];
-            fieldMap.put("key", pos);
-            fieldMap.put("layer", "pos");
-            // make category-specific fieldMap entry
-            // negate field (see above)
-            if (negate) {
-                fieldMap.put("match", "match:ne");
-            } else {
-                fieldMap.put("match", "match:eq");
-            }
-//			List<String> morphValues = parseMorph(node.getChild(0).toStringTree());
-//			System.err.println(morphValues);
-//			if (morphValues.size() == 1) {
-//				LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
-//				token.put("key", fieldMap);
-//				
-//				fieldMap.put("@type", "korap:term");
-//				fieldMap.put("key", morphValues.get(0));
-//				// make category-specific fieldMap entry
-//				// negate field (see above)
-//				if (negate) {
-//					fieldMap.put("operation", "operation:"+ "!=");
-//				} else {
-//					fieldMap.put("operation", "operation:"+ "=");
-//				}
-//			} else {
-//				LinkedHashMap<String, Object> conjGroup = new LinkedHashMap<String, Object>();
-//				token.put("key", conjGroup);
-//				ArrayList<Object> conjOperands = new ArrayList<Object>();
-//				conjGroup.put("@type", "korap:group");
-//				conjGroup.put("operation", "operation:"+ "and");
-//				conjGroup.put("operands", conjOperands);
-//				for (String value : morphValues) {
-//					LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
-//					token.put("key", fieldMap);
-//					
-//					fieldMap.put("@type", "korap:term");
-//					fieldMap.put("key", value);
-//					// make category-specific fieldMap entry
-//					// negate field (see above)
-//					if (negate) {
-//						fieldMap.put("operation", "operation:"+ "!=");
-//					} else {
-//						fieldMap.put("operation", "operation:"+ "=");
-//					}
-//				}
-//			}
+		if (nodeCat.equals("OPMORPH")) {
+			//Step I: get info
+			String[] morphterms = node.getChild(0).toStringTree().split("&");
+			LinkedHashMap<String, Object> token = new LinkedHashMap<String, Object>();
+			token.put("@type", "korap:token");
+			ArrayList<Object> terms = new ArrayList<Object>();
+			for (String morphterm : morphterms) {
+				String[] attrval = morphterm.split("=");
+				if (attrval[0].endsWith("!")) {
+					negate = !negate;
+					attrval[0] = attrval[0].replace("!", "");
+				}
+				String[] foundrylayer = attrval[0].split("/");
+				LinkedHashMap<String, Object> fieldMap = new LinkedHashMap<String, Object>();
+				fieldMap.put("@type", "korap:term");
+				//     			fieldMap.put("key", "morph:"+node.getChild(0).toString().replace(" ", "_"));
+				fieldMap.put("key", attrval[1]);
+				if (foundrylayer.length==1) {
+					fieldMap.put("layer", foundrylayer[0]);
+				} else {
+					fieldMap.put("foundry", foundrylayer[0]);
+					fieldMap.put("layer", foundrylayer[1]);
+				}
+				
+				// make category-specific fieldMap entry
+				// negate field (see above)
+				if (negate) {
+					fieldMap.put("match", "match:ne");
+				} else {
+					fieldMap.put("match", "match:eq");
+				}
+				terms.add(fieldMap);
+			}
+			if (morphterms.length == 1) {
+				token.put("wrap", terms);
+			} else {
+				LinkedHashMap<String, Object> termGroup = makeTermGroup("and");
+				termGroup.put("operands", terms);
+				token.put("wrap", termGroup);
+			}
+			//Step II: decide where to put
+			putIntoSuperObject(token, 0);
+			visited.add(node.getChild(0));
+		}
 
+		if (nodeCat.equals("OPELEM")) {
+			// Step I: create element
+			LinkedHashMap<String, Object> span = makeSpan();
+			if (node.getChild(0).toStringTree().equals("EMPTY")) {
 
-            //Step II: decide where to put
-            putIntoSuperObject(token, 0);
-            visited.add(node.getChild(0));
-        }
-
-        if (nodeCat.equals("OPELEM")) {
-            // Step I: create element
-            LinkedHashMap<String, Object> span = makeSpan();
-            if (node.getChild(0).toStringTree().equals("EMPTY")) {
-
-            } else {
-                int elname = 0;
-                Tree elnameNode = getFirstChildWithCat(node, "ELNAME");
-                if (elnameNode != null) {
-                    span.put("key", elnameNode.getChild(0).toStringTree().toLowerCase());
-                    elname = 1;
-                }
-                if (node.getChildCount() > elname) {
-                    /*
+			} else {
+				int elname = 0;
+				Tree elnameNode = getFirstChildWithCat(node, "ELNAME");
+				if (elnameNode != null) {
+					span.put("key", elnameNode.getChild(0).toStringTree().toLowerCase());
+					elname = 1;
+				}
+				if (node.getChildCount() > elname) {
+					/*
 					 * Attributes can carry several values, like #ELEM(W ANA != 'N V'), 
 					 * denoting a word whose POS is neither N nor V.
 					 * When seeing this, create a sub-termGroup and put it into the top-level
@@ -305,396 +286,396 @@
 					 * top-level group (in order to avoid a top-level group that only
 					 * contains a sub-group).
 					 */
-                    LinkedHashMap<String, Object> termGroup = makeTermGroup("and");
-                    ArrayList<Object> termGroupOperands = (ArrayList<Object>) termGroup.get("operands");
-                    for (int i = elname; i < node.getChildCount(); i++) {
-                        Tree attrNode = node.getChild(i);
-                        if (attrNode.getChildCount() == 2) {
-                            LinkedHashMap<String, Object> term = makeTerm();
-                            termGroupOperands.add(term);
-                            String layer = attrNode.getChild(0).toStringTree();
-                            String[] splitted = layer.split("/");
-                            if (splitted.length > 1) {
-                                term.put("foundry", splitted[0]);
-                                layer = splitted[1];
-                            }
-                            term.put("layer", translateMorph(layer));
-                            term.put("key", attrNode.getChild(1).toStringTree());
-                            String match = getNodeCat(attrNode).equals("EQ") ? "eq" : "ne";
-                            term.put("match", "match:" + match);
-                        } else {
-                            LinkedHashMap<String, Object> subTermGroup = makeTermGroup("and");
-                            ArrayList<Object> subTermGroupOperands = (ArrayList<Object>) subTermGroup.get("operands");
-                            int j;
-                            for (j = 1; j < attrNode.getChildCount(); j++) {
-                                LinkedHashMap<String, Object> term = makeTerm();
-                                String layer = attrNode.getChild(0).toStringTree();
-                                String[] splitted = layer.split("/");
-                                if (splitted.length > 1) {
-                                    term.put("foundry", splitted[0]);
-                                    layer = splitted[1];
-                                }
-                                term.put("layer", translateMorph(layer));
-                                term.put("key", attrNode.getChild(j).toStringTree());
-                                String match = getNodeCat(attrNode).equals("EQ") ? "eq" : "ne";
-                                term.put("match", "match:" + match);
-                                if (node.getChildCount() == elname + 1) {
-                                    termGroupOperands.add(term);
-                                } else {
-                                    subTermGroupOperands.add(term);
-                                }
-                            }
-                            if (node.getChildCount() > elname + 1) {
-                                termGroupOperands.add(subTermGroup);
-                            }
-                        }
-                        if (getNodeCat(attrNode).equals("NOTEQ")) negate = true;
-                    }
-                    span.put("attr", termGroup);
-                }
-            }
+					LinkedHashMap<String, Object> termGroup = makeTermGroup("and");
+					ArrayList<Object> termGroupOperands = (ArrayList<Object>) termGroup.get("operands");
+					for (int i = elname; i < node.getChildCount(); i++) {
+						Tree attrNode = node.getChild(i);
+						if (attrNode.getChildCount() == 2) {
+							LinkedHashMap<String, Object> term = makeTerm();
+							termGroupOperands.add(term);
+							String layer = attrNode.getChild(0).toStringTree();
+							String[] splitted = layer.split("/");
+							if (splitted.length > 1) {
+								term.put("foundry", splitted[0]);
+								layer = splitted[1];
+							}
+							term.put("layer", translateMorph(layer));
+							term.put("key", attrNode.getChild(1).toStringTree());
+							String match = getNodeCat(attrNode).equals("EQ") ? "eq" : "ne";
+							term.put("match", "match:" + match);
+						} else {
+							LinkedHashMap<String, Object> subTermGroup = makeTermGroup("and");
+							ArrayList<Object> subTermGroupOperands = (ArrayList<Object>) subTermGroup.get("operands");
+							int j;
+							for (j = 1; j < attrNode.getChildCount(); j++) {
+								LinkedHashMap<String, Object> term = makeTerm();
+								String layer = attrNode.getChild(0).toStringTree();
+								String[] splitted = layer.split("/");
+								if (splitted.length > 1) {
+									term.put("foundry", splitted[0]);
+									layer = splitted[1];
+								}
+								term.put("layer", translateMorph(layer));
+								term.put("key", attrNode.getChild(j).toStringTree());
+								String match = getNodeCat(attrNode).equals("EQ") ? "eq" : "ne";
+								term.put("match", "match:" + match);
+								if (node.getChildCount() == elname + 1) {
+									termGroupOperands.add(term);
+								} else {
+									subTermGroupOperands.add(term);
+								}
+							}
+							if (node.getChildCount() > elname + 1) {
+								termGroupOperands.add(subTermGroup);
+							}
+						}
+						if (getNodeCat(attrNode).equals("NOTEQ")) negate = true;
+					}
+					span.put("attr", termGroup);
+				}
+			}
 
-            //Step II: decide where to put
-            putIntoSuperObject(span);
-        }
+			//Step II: decide where to put
+			putIntoSuperObject(span);
+		}
 
-        if (nodeCat.equals("OPLABEL")) {
-            // Step I: create element
-            LinkedHashMap<String, Object> elem = new LinkedHashMap<String, Object>();
-            elem.put("@type", "korap:span");
-            elem.put("key", node.getChild(0).toStringTree().replaceAll("<|>", ""));
-            //Step II: decide where to put
-            putIntoSuperObject(elem);
-        }
+		if (nodeCat.equals("OPLABEL")) {
+			// Step I: create element
+			LinkedHashMap<String, Object> elem = new LinkedHashMap<String, Object>();
+			elem.put("@type", "korap:span");
+			elem.put("key", node.getChild(0).toStringTree().replaceAll("<|>", ""));
+			//Step II: decide where to put
+			putIntoSuperObject(elem);
+		}
 
-        if (nodeCat.equals("OPAND") || nodeCat.equals("OPNOT")) {
-            // Step I: create group
-            LinkedHashMap<String, Object> distgroup = new LinkedHashMap<String, Object>();
-            distgroup.put("@type", "korap:group");
-            distgroup.put("operation", "operation:sequence");
-            ArrayList<Object> distances = new ArrayList<Object>();
-            LinkedHashMap<String, Object> zerodistance = new LinkedHashMap<String, Object>();
-            zerodistance.put("@type", "korap:distance");
-            zerodistance.put("key", "t");
-            zerodistance.put("min", 0);
-            zerodistance.put("max", 0);
-            if (nodeCat.equals("OPNOT")) zerodistance.put("exclude", true);
-            distances.add(zerodistance);
-            distgroup.put("distances", distances);
-            distgroup.put("operands", new ArrayList<Object>());
-            objectStack.push(distgroup);
-            stackedObjects++;
-            // Step II: decide where to put
-            putIntoSuperObject(distgroup, 1);
-        }
+		if (nodeCat.equals("OPAND") || nodeCat.equals("OPNOT")) {
+			// Step I: create group
+			LinkedHashMap<String, Object> distgroup = new LinkedHashMap<String, Object>();
+			distgroup.put("@type", "korap:group");
+			distgroup.put("operation", "operation:sequence");
+			ArrayList<Object> distances = new ArrayList<Object>();
+			LinkedHashMap<String, Object> zerodistance = new LinkedHashMap<String, Object>();
+			zerodistance.put("@type", "cosmas:distance");
+			zerodistance.put("key", "t");
+			zerodistance.put("min", 0);
+			zerodistance.put("max", 0);
+			if (nodeCat.equals("OPNOT")) zerodistance.put("exclude", true);
+			distances.add(zerodistance);
+			distgroup.put("distances", distances);
+			distgroup.put("operands", new ArrayList<Object>());
+			objectStack.push(distgroup);
+			stackedObjects++;
+			// Step II: decide where to put
+			putIntoSuperObject(distgroup, 1);
+		}
 
-        if (nodeCat.equals("OPOR")) {
-            // Step I: create group
-            LinkedHashMap<String, Object> disjunction = new LinkedHashMap<String, Object>();
-            disjunction.put("@type", "korap:group");
-            disjunction.put("operation", "operation:or");
-            disjunction.put("operands", new ArrayList<Object>());
-            objectStack.push(disjunction);
-            stackedObjects++;
-            // Step II: decide where to put
-            putIntoSuperObject(disjunction, 1);
-        }
+		if (nodeCat.equals("OPOR")) {
+			// Step I: create group
+			LinkedHashMap<String, Object> disjunction = new LinkedHashMap<String, Object>();
+			disjunction.put("@type", "korap:group");
+			disjunction.put("operation", "operation:or");
+			disjunction.put("operands", new ArrayList<Object>());
+			objectStack.push(disjunction);
+			stackedObjects++;
+			// Step II: decide where to put
+			putIntoSuperObject(disjunction, 1);
+		}
 
-        if (nodeCat.equals("OPPROX")) {
-            // collect info
-            Tree prox_opts = node.getChild(0);
-            Tree typ = prox_opts.getChild(0);
-            Tree dist_list = prox_opts.getChild(1);
-            // Step I: create group
-            LinkedHashMap<String, Object> group = makeGroup("sequence");
-            
-            ArrayList<Object> constraints = new ArrayList<Object>();
-            boolean exclusion = typ.getChild(0).toStringTree().equals("EXCL");
+		if (nodeCat.equals("OPPROX")) {
+			// collect info
+			Tree prox_opts = node.getChild(0);
+			Tree typ = prox_opts.getChild(0);
+			Tree dist_list = prox_opts.getChild(1);
+			// Step I: create group
+			LinkedHashMap<String, Object> group = makeGroup("sequence");
 
-            boolean inOrder = false;
-            boolean invertedOperands = false;
-            
-            group.put("inOrder", inOrder);
-            group.put("distances", constraints);
-            
-            boolean putIntoOverlapDisjunction = false;
+			ArrayList<Object> constraints = new ArrayList<Object>();
+			boolean exclusion = typ.getChild(0).toStringTree().equals("EXCL");
 
-            int min = 0, max = 0;
-            // possibly several distance constraints
-            for (int i = 0; i < dist_list.getChildCount(); i++) {
-                String direction = dist_list.getChild(i).getChild(0).getChild(0).toStringTree().toLowerCase();
-                String minStr = dist_list.getChild(i).getChild(1).getChild(0).toStringTree();
-                String maxStr = dist_list.getChild(i).getChild(1).getChild(1).toStringTree();
-                String meas = dist_list.getChild(i).getChild(2).getChild(0).toStringTree();
-                if (minStr.equals("VAL0")) {
-                    minStr = "0";
-                }
-                min = Integer.parseInt(minStr);
-                max = Integer.parseInt(maxStr);
-                // If zero word-distance, wrap this sequence in a disjunction along with an overlap position
-                // between the two operands
-     /*   
+			boolean inOrder = false;
+			boolean invertedOperands = false;
+
+			group.put("inOrder", inOrder);
+			group.put("distances", constraints);
+
+			boolean putIntoOverlapDisjunction = false;
+
+			int min = 0, max = 0;
+			// possibly several distance constraints
+			for (int i = 0; i < dist_list.getChildCount(); i++) {
+				String direction = dist_list.getChild(i).getChild(0).getChild(0).toStringTree().toLowerCase();
+				String minStr = dist_list.getChild(i).getChild(1).getChild(0).toStringTree();
+				String maxStr = dist_list.getChild(i).getChild(1).getChild(1).toStringTree();
+				String meas = dist_list.getChild(i).getChild(2).getChild(0).toStringTree();
+				if (minStr.equals("VAL0")) {
+					minStr = "0";
+				}
+				min = Integer.parseInt(minStr);
+				max = Integer.parseInt(maxStr);
+				// If zero word-distance, wrap this sequence in a disjunction along with an overlap position
+				// between the two operands
+				/*   
      	XXX: This is currently deactivated. Uncomment to activate treatment of zero-word distances as overlap-alternatives
      			(see google doc on special distances serialization)
-     	
+
                 if (meas.equals("w") && min == 0) {
                 	min = 1;
                 	putIntoOverlapDisjunction = true;
                 }
-     */
-                if (!meas.equals("w") && min == 0 ) {
-                	processSpanDistance(meas,min,max);
-                }
-                LinkedHashMap<String, Object> distance = makeDistance(meas,min,max);
-                if (exclusion) {
-                    distance.put("exclude", true);
-                }
-//                if (! openNodeCats.get(1).equals("OPNHIT")) {
-                	constraints.add(distance);
-//                }
-                if (i==0) {
-                	if (direction.equals("plus")) {
-                        inOrder = true;
-                    } else if (direction.equals("minus")) {
-                        inOrder = true;
-                        invertedOperands = true;
-                    } else if (direction.equals("both")) {
-                    	inOrder = false;
-                    }
-                }
-            }
-            group.put("inOrder", inOrder);
-            LinkedHashMap<String, Object> embeddedSequence = group;
-            
-            if (! (openNodeCats.get(1).equals("OPBEG") || openNodeCats.get(1).equals("OPEND") || inOPALL || openNodeCats.get(1).equals("OPNHIT"))) {
-                wrapOperandInClass(node,1,classCounter);
-                wrapOperandInClass(node,2,classCounter);
-                group = wrapInReference(group, 1024+classCounter++);
-            } else if (openNodeCats.get(1).equals("OPNHIT")) {
-            	LinkedHashMap<String,Object> repetition = makeRepetition(min, max);
-            	((ArrayList<Object>) repetition.get("operands")).add(makeToken());
-            	// TODO go on with this: put the repetition into a class and put it in between the operands
-            	// -> what if there's several distance constraints. with different keys, like /w4,s0? 
-            }
-            
-            LinkedHashMap<String,Object> sequence = null;
-            if (putIntoOverlapDisjunction) {
-            	sequence = embeddedSequence;
-            	group = makeGroup("or");
-            	ArrayList<Object> disjOperands = (ArrayList<Object>) group.get("operands");
-            	String[] sharedClasses = new String[]{"intersects"};
-            	LinkedHashMap<String,Object> overlapsGroup = makePosition(new String[0], sharedClasses);
-            	
-            	ArrayList<Object> overlapsOperands = (ArrayList<Object>) overlapsGroup.get("operands");
-            	// this ensures identity of the operands lists and thereby a distribution of the operands for both created objects 
-            	sequence.put("operands", overlapsOperands);
-            	if (invertedOperands) {
-                    invertedOperandsLists.push(overlapsOperands);
-            	}
-            	disjOperands.add(overlapsGroup);
-            	disjOperands.add(wrapInReference(sequence, 0));
-            	// Step II: decide where to put
-            	putIntoSuperObject(group, 0);
-            	objectStack.push(sequence);
-            }
-            else {
-            	if (invertedOperands) {
-            		ArrayList<Object> operands = (ArrayList<Object>) embeddedSequence.get("operands");
-                    invertedOperandsLists.push(operands);
-            	}
-            	// Step II: decide where to put
-            	putIntoSuperObject(group, 0);
-            	objectStack.push(embeddedSequence);
-            }
-            stackedObjects++;
-            visited.add(node.getChild(0));
-        }
+				 */
+				if (!meas.equals("w") && min == 0 ) {
+					processSpanDistance(meas,min,max);
+				}
+				LinkedHashMap<String, Object> distance = makeDistance(meas,min,max);
+				if (exclusion) {
+					distance.put("exclude", true);
+				}
+				//                if (! openNodeCats.get(1).equals("OPNHIT")) {
+				constraints.add(distance);
+				//                }
+				if (i==0) {
+					if (direction.equals("plus")) {
+						inOrder = true;
+					} else if (direction.equals("minus")) {
+						inOrder = true;
+						invertedOperands = true;
+					} else if (direction.equals("both")) {
+						inOrder = false;
+					}
+				}
+			}
+			group.put("inOrder", inOrder);
+			LinkedHashMap<String, Object> embeddedSequence = group;
 
-        // inlcusion or overlap
-        if (nodeCat.equals("OPIN") || nodeCat.equals("OPOV")) {
-            // Step I: create group
-        	wrapOperandInClass(node,2,classCounter++);
-        	wrapOperandInClass(node,1,classCounter++);
-//            LinkedHashMap<String, Object> posgroup = makePosition(null);
-            LinkedHashMap<String, Object> posgroup = makeGroup("position");
-            LinkedHashMap<String, Object> positionOptions;
-//            posgroup
-            if (nodeCat.equals("OPIN")) {
-            	positionOptions = parseOPINOptions(node);
-            } else {
-            	positionOptions = parseOPOVOptions(node);
-            }
-            posgroup.put("frames", positionOptions.get("frames"));
-            posgroup.put("frame", positionOptions.get("frame"));
-            if (positionOptions.containsKey("exclude")) {
-            	posgroup.put("exclude", positionOptions.get("exclude"));
-            }
-            if (positionOptions.containsKey("grouping")) {
-            	posgroup.put("grouping", positionOptions.get("grouping"));
-            }
-            objectStack.push(posgroup);
-            // mark this an inverted operands object
-            invertedOperandsLists.push((ArrayList<Object>) posgroup.get("operands"));
-            stackedObjects++;
-            // Step II: wrap in reference and decide where to put
-            ArrayList<String> check = (ArrayList<String>) positionOptions.get("classRefCheck");
-            Integer[] classIn = new Integer[]{1024+classCounter-2,1024+classCounter-1};
-            LinkedHashMap<String, Object> classRefCheck = makeClassRefCheck(check, classIn, 1024+classCounter);
-            ((ArrayList<Object>) classRefCheck.get("operands")).add(posgroup);
-            LinkedHashMap<String, Object> focusGroup = null;
-            if ((boolean) positionOptions.get("matchall") == true) {
-            	focusGroup = makeResetReference();
-            	((ArrayList<Object>) focusGroup.get("operands")).add(classRefCheck);
-            } else { // match only first argument
-            	focusGroup = wrapInReference(classRefCheck, 1024+classCounter-1);
-            }
-            putIntoSuperObject(focusGroup, 1);
-        }
+			if (! (openNodeCats.get(1).equals("OPBEG") || openNodeCats.get(1).equals("OPEND") || inOPALL || openNodeCats.get(1).equals("OPNHIT"))) {
+				wrapOperandInClass(node,1,classCounter);
+				wrapOperandInClass(node,2,classCounter);
+				group = wrapInReference(group, 1024+classCounter++);
+			} else if (openNodeCats.get(1).equals("OPNHIT")) {
+				LinkedHashMap<String,Object> repetition = makeRepetition(min, max);
+				((ArrayList<Object>) repetition.get("operands")).add(makeToken());
+				// TODO go on with this: put the repetition into a class and put it in between the operands
+				// -> what if there's several distance constraints. with different keys, like /w4,s0? 
+			}
 
-        // Wrap the argument of an #IN operator in a previously defined container
-        if (nodeCat.equals("ARG1") || nodeCat.equals("ARG2"))  {
-        	Tree parent = node.getParent();
-//        	String child = getNodeCat(node.getChild(0));
-//        	if (child.equals("OPWF") | child.equals("OPLEM") | child.equals("OPELEM") | child.equals("OPMOPRH") | child.equals("OPLABEL")) {
-    		if (operandWrap.containsRow(parent)) {
-        		// Step I: create group
-    			int argNr = nodeCat.equals("ARG1") ? 1 : 2;
+			LinkedHashMap<String,Object> sequence = null;
+			if (putIntoOverlapDisjunction) {
+				sequence = embeddedSequence;
+				group = makeGroup("or");
+				ArrayList<Object> disjOperands = (ArrayList<Object>) group.get("operands");
+				String[] sharedClasses = new String[]{"intersects"};
+				LinkedHashMap<String,Object> overlapsGroup = makePosition(new String[0], sharedClasses);
+
+				ArrayList<Object> overlapsOperands = (ArrayList<Object>) overlapsGroup.get("operands");
+				// this ensures identity of the operands lists and thereby a distribution of the operands for both created objects 
+				sequence.put("operands", overlapsOperands);
+				if (invertedOperands) {
+					invertedOperandsLists.push(overlapsOperands);
+				}
+				disjOperands.add(overlapsGroup);
+				disjOperands.add(wrapInReference(sequence, 0));
+				// Step II: decide where to put
+				putIntoSuperObject(group, 0);
+				objectStack.push(sequence);
+			}
+			else {
+				if (invertedOperands) {
+					ArrayList<Object> operands = (ArrayList<Object>) embeddedSequence.get("operands");
+					invertedOperandsLists.push(operands);
+				}
+				// Step II: decide where to put
+				putIntoSuperObject(group, 0);
+				objectStack.push(embeddedSequence);
+			}
+			stackedObjects++;
+			visited.add(node.getChild(0));
+		}
+
+		// inlcusion or overlap
+		if (nodeCat.equals("OPIN") || nodeCat.equals("OPOV")) {
+			// Step I: create group
+			wrapOperandInClass(node,2,classCounter++);
+			wrapOperandInClass(node,1,classCounter++);
+			//            LinkedHashMap<String, Object> posgroup = makePosition(null);
+			LinkedHashMap<String, Object> posgroup = makeGroup("position");
+			LinkedHashMap<String, Object> positionOptions;
+			//            posgroup
+			if (nodeCat.equals("OPIN")) {
+				positionOptions = parseOPINOptions(node);
+			} else {
+				positionOptions = parseOPOVOptions(node);
+			}
+			posgroup.put("frames", positionOptions.get("frames"));
+			posgroup.put("frame", positionOptions.get("frame"));
+			if (positionOptions.containsKey("exclude")) {
+				posgroup.put("exclude", positionOptions.get("exclude"));
+			}
+			if (positionOptions.containsKey("grouping")) {
+				posgroup.put("grouping", positionOptions.get("grouping"));
+			}
+			objectStack.push(posgroup);
+			// mark this an inverted operands object
+			invertedOperandsLists.push((ArrayList<Object>) posgroup.get("operands"));
+			stackedObjects++;
+			// Step II: wrap in reference and decide where to put
+			ArrayList<String> check = (ArrayList<String>) positionOptions.get("classRefCheck");
+			Integer[] classIn = new Integer[]{1024+classCounter-2,1024+classCounter-1};
+			LinkedHashMap<String, Object> classRefCheck = makeClassRefCheck(check, classIn, 1024+classCounter);
+			((ArrayList<Object>) classRefCheck.get("operands")).add(posgroup);
+			LinkedHashMap<String, Object> focusGroup = null;
+			if ((boolean) positionOptions.get("matchall") == true) {
+				focusGroup = makeResetReference();
+				((ArrayList<Object>) focusGroup.get("operands")).add(classRefCheck);
+			} else { // match only first argument
+				focusGroup = wrapInReference(classRefCheck, 1024+classCounter-1);
+			}
+			putIntoSuperObject(focusGroup, 1);
+		}
+
+		// Wrap the argument of an #IN operator in a previously defined container
+		if (nodeCat.equals("ARG1") || nodeCat.equals("ARG2"))  {
+			Tree parent = node.getParent();
+			//        	String child = getNodeCat(node.getChild(0));
+			//        	if (child.equals("OPWF") | child.equals("OPLEM") | child.equals("OPELEM") | child.equals("OPMOPRH") | child.equals("OPLABEL")) {
+			if (operandWrap.containsRow(parent)) {
+				// Step I: create group
+				int argNr = nodeCat.equals("ARG1") ? 1 : 2;
 				LinkedHashMap<String,Object> container = operandWrap.row(parent).get(argNr);
 				// Step II: ingest
 				if (container!=null) {
 					objectStack.push(container);
-                    stackedObjects++;
-                    putIntoSuperObject(container,1);
-    			}
-        	}
-//        	}
-        }
+					stackedObjects++;
+					putIntoSuperObject(container,1);
+				}
+			}
+			//        	}
+		}
 
-        if (nodeCat.equals("OPALL")) {
-        	inOPALL = true;
-        }
-        
-        if (nodeCat.equals("OPNHIT")) {
-            Integer[] classRef = new Integer[]{1024+classCounter+1, 1024+classCounter+2}; 
-//            classRef.add(classCounter + 1);  // yes, do this twice (two classes)!
-            LinkedHashMap<String, Object> group = makeReference(1024+classCounter);
-            LinkedHashMap<String, Object> classRefCheck = makeClassRefOp("classRefOp:inversion", classRef, classCounter+1024);
-            ArrayList<Object> operands = new ArrayList<Object>();
-            operands.add(classRefCheck);
-            group.put("operands", operands);
-            classCounter++;
-            wrapOperandInClass(node.getChild(0),1,classCounter++); // direct child is OPPROX
-            wrapOperandInClass(node.getChild(0),2,classCounter++);
-            objectStack.push(classRefCheck);
-            stackedObjects++;
-            putIntoSuperObject(group, 1);
-        }
+		if (nodeCat.equals("OPALL")) {
+			inOPALL = true;
+		}
 
-        if (nodeCat.equals("OPEND") || nodeCat.equals("OPBEG")) {
-            // Step I: create group
-            LinkedHashMap<String, Object> beggroup = new LinkedHashMap<String, Object>();
-            beggroup.put("@type", "korap:reference");
-            beggroup.put("operation", "operation:focus");
-            ArrayList<Integer> spanRef = new ArrayList<Integer>();
-            if (nodeCat.equals("OPBEG")) {
-                spanRef.add(0);
-                spanRef.add(1);
-            } else if (nodeCat.equals("OPEND")) {
-                spanRef.add(-1);
-                spanRef.add(1);
-            }
-            beggroup.put("spanRef", spanRef);
-            beggroup.put("operands", new ArrayList<Object>());
-            objectStack.push(beggroup);
-            stackedObjects++;
+		if (nodeCat.equals("OPNHIT")) {
+			Integer[] classRef = new Integer[]{1024+classCounter+1, 1024+classCounter+2}; 
+			//            classRef.add(classCounter + 1);  // yes, do this twice (two classes)!
+			LinkedHashMap<String, Object> group = makeReference(1024+classCounter);
+			LinkedHashMap<String, Object> classRefCheck = makeClassRefOp("classRefOp:inversion", classRef, classCounter+1024);
+			ArrayList<Object> operands = new ArrayList<Object>();
+			operands.add(classRefCheck);
+			group.put("operands", operands);
+			classCounter++;
+			wrapOperandInClass(node.getChild(0),1,classCounter++); // direct child is OPPROX
+			wrapOperandInClass(node.getChild(0),2,classCounter++);
+			objectStack.push(classRefCheck);
+			stackedObjects++;
+			putIntoSuperObject(group, 1);
+		}
 
-            // Step II: decide where to put
-            putIntoSuperObject(beggroup, 1);
-        }
+		if (nodeCat.equals("OPEND") || nodeCat.equals("OPBEG")) {
+			// Step I: create group
+			LinkedHashMap<String, Object> beggroup = new LinkedHashMap<String, Object>();
+			beggroup.put("@type", "korap:reference");
+			beggroup.put("operation", "operation:focus");
+			ArrayList<Integer> spanRef = new ArrayList<Integer>();
+			if (nodeCat.equals("OPBEG")) {
+				spanRef.add(0);
+				spanRef.add(1);
+			} else if (nodeCat.equals("OPEND")) {
+				spanRef.add(-1);
+				spanRef.add(1);
+			}
+			beggroup.put("spanRef", spanRef);
+			beggroup.put("operands", new ArrayList<Object>());
+			objectStack.push(beggroup);
+			stackedObjects++;
 
-        if (nodeCat.equals("OPBED")) {
-            // Step I: create group
-            int optsChild = node.getChildCount() - 1;
-            Tree conditions = node.getChild(optsChild).getChild(0);
+			// Step II: decide where to put
+			putIntoSuperObject(beggroup, 1);
+		}
 
-            // create a containing group expressing the submatch constraint on the first argument
-            ArrayList<Integer> spanRef = new ArrayList<Integer>();
-            spanRef.add(1);
-            LinkedHashMap<String, Object> submatchgroup = makeReference(1024+classCounter);
-            ArrayList<Object> submatchoperands = new ArrayList<Object>();
-            submatchgroup.put("operands", submatchoperands);
-            putIntoSuperObject(submatchgroup);
+		if (nodeCat.equals("OPBED")) {
+			// Step I: create group
+			int optsChild = node.getChildCount() - 1;
+			Tree conditions = node.getChild(optsChild).getChild(0);
 
-            // Distinguish two cases. Normal case: query has just one condition, like #BED(X, sa) ...
-            if (conditions.getChildCount() == 1) {
-                CosmasCondition c = new CosmasCondition(conditions.getChild(0));
+			// create a containing group expressing the submatch constraint on the first argument
+			ArrayList<Integer> spanRef = new ArrayList<Integer>();
+			spanRef.add(1);
+			LinkedHashMap<String, Object> submatchgroup = makeReference(1024+classCounter);
+			ArrayList<Object> submatchoperands = new ArrayList<Object>();
+			submatchgroup.put("operands", submatchoperands);
+			putIntoSuperObject(submatchgroup);
 
-                // create the group expressing the position constraint
-                String[] frames = new String[]{c.position};
-                String[] sharedClasses = new String[]{};  // OPBED only defines frame constraint, neglects intersection type
-            	LinkedHashMap<String,Object> posgroup = makePosition(frames, sharedClasses);
-//                LinkedHashMap<String, Object> posgroup = makePosition(c.position);
-                ArrayList<Object> operands = (ArrayList<Object>) posgroup.get("operands");
-                if (c.negated) posgroup.put("exclude", true);
+			// Distinguish two cases. Normal case: query has just one condition, like #BED(X, sa) ...
+			if (conditions.getChildCount() == 1) {
+				CosmasCondition c = new CosmasCondition(conditions.getChild(0));
 
-                // create span representing the element expressed in the condition
-                LinkedHashMap<String, Object> bedElem = new LinkedHashMap<String, Object>();
-                bedElem.put("@type", "korap:span");
-                bedElem.put("key", c.elem);
+				// create the group expressing the position constraint
+				String[] frames = new String[]{c.position};
+				String[] sharedClasses = new String[]{};  // OPBED only defines frame constraint, neglects intersection type
+				LinkedHashMap<String,Object> posgroup = makePosition(frames, sharedClasses);
+				//                LinkedHashMap<String, Object> posgroup = makePosition(c.position);
+				ArrayList<Object> operands = (ArrayList<Object>) posgroup.get("operands");
+				if (c.negated) posgroup.put("exclude", true);
 
-                // create a class group containing the argument, in order to submatch the arg.
-                LinkedHashMap<String, Object> classGroup = makeSpanClass(classCounter++);
-                objectStack.push(classGroup);
-                stackedObjects++;
-                operands.add(bedElem);
-                operands.add(classGroup);
-                // Step II: decide where to put
-                submatchoperands.add(posgroup);
+				// create span representing the element expressed in the condition
+				LinkedHashMap<String, Object> bedElem = new LinkedHashMap<String, Object>();
+				bedElem.put("@type", "korap:span");
+				bedElem.put("key", c.elem);
 
-                // ... or the query has several conditions specified, like #BED(XY, sa,-pa). In that case,
-                //     use 'focus' operations to create nested conditions
-            } else {
-                // node has several conditions (like 'sa, -pa')
-                // -> create identity position group and embed all position groups there
-                LinkedHashMap<String, Object> conjunct = makePosition(new String[]{"frames:matches"}, new String[]{"classRefCheck:equals"});
-//                ArrayList<Object> distances = new ArrayList<Object>();
-//                distances.add(makeDistance("w", 0,0));
-//                conjunct.put("distances", distances);
-                ArrayList<Object> operands = new ArrayList<Object>();
-                conjunct.put("operands", operands);
-                ArrayList<Object> distributedOperands = new ArrayList<Object>();
+				// create a class group containing the argument, in order to submatch the arg.
+				LinkedHashMap<String, Object> classGroup = makeSpanClass(classCounter++);
+				objectStack.push(classGroup);
+				stackedObjects++;
+				operands.add(bedElem);
+				operands.add(classGroup);
+				// Step II: decide where to put
+				submatchoperands.add(posgroup);
 
-                for (int i = 0; i < conditions.getChildCount(); i++) {
-                    // for each condition, create a position group containing a class group.
-                    // make position group
-                    CosmasCondition c = new CosmasCondition(conditions.getChild(i));
-                    String[] frames = new String[]{c.position};
-                    String[] sharedClasses = new String[]{};  // OPBED only defines frame constraint, neglects intersection type
-                	LinkedHashMap<String,Object> posGroup = makePosition(frames, sharedClasses);
-                    operands.add(posGroup);
-                    if (c.negated) posGroup.put("exclude", "true");
-                    ArrayList<Object> posOperands = new ArrayList<Object>();
+				// ... or the query has several conditions specified, like #BED(XY, sa,-pa). In that case,
+				//     use 'focus' operations to create nested conditions
+			} else {
+				// node has several conditions (like 'sa, -pa')
+				// -> create identity position group and embed all position groups there
+				LinkedHashMap<String, Object> conjunct = makePosition(new String[]{"frames:matches"}, new String[]{"classRefCheck:equals"});
+				//                ArrayList<Object> distances = new ArrayList<Object>();
+				//                distances.add(makeDistance("w", 0,0));
+				//                conjunct.put("distances", distances);
+				ArrayList<Object> operands = new ArrayList<Object>();
+				conjunct.put("operands", operands);
+				ArrayList<Object> distributedOperands = new ArrayList<Object>();
 
-                    // make class group
-                    LinkedHashMap<String, Object> classGroup = makeSpanClass(classCounter++);
-                    classGroup.put("operands", distributedOperands);
+				for (int i = 0; i < conditions.getChildCount(); i++) {
+					// for each condition, create a position group containing a class group.
+					// make position group
+					CosmasCondition c = new CosmasCondition(conditions.getChild(i));
+					String[] frames = new String[]{c.position};
+					String[] sharedClasses = new String[]{};  // OPBED only defines frame constraint, neglects intersection type
+					LinkedHashMap<String,Object> posGroup = makePosition(frames, sharedClasses);
+					operands.add(posGroup);
+					if (c.negated) posGroup.put("exclude", "true");
+					ArrayList<Object> posOperands = new ArrayList<Object>();
 
-                    // put the span and the class group into the position group
-                    posGroup.put("operands", posOperands);
-                    LinkedHashMap<String, Object> span = new LinkedHashMap<String, Object>();
-                    posOperands.add(span);
-                    posOperands.add(classGroup);
-                    span.put("@type", "korap:span");
-                    span.put("key", c.elem);
-                    objectStack.push(classGroup);
-                }
-                submatchoperands.add(conjunct);
-            }
+					// make class group
+					LinkedHashMap<String, Object> classGroup = makeSpanClass(classCounter++);
+					classGroup.put("operands", distributedOperands);
 
-        }
-        objectsToPop.push(stackedObjects);
-        toWrapsToPop.push(stackedToWrap);
-		
+					// put the span and the class group into the position group
+					posGroup.put("operands", posOperands);
+					LinkedHashMap<String, Object> span = new LinkedHashMap<String, Object>();
+					posOperands.add(span);
+					posOperands.add(classGroup);
+					span.put("@type", "korap:span");
+					span.put("key", c.elem);
+					objectStack.push(classGroup);
+				}
+				submatchoperands.add(conjunct);
+			}
+
+		}
+		objectsToPop.push(stackedObjects);
+		toWrapsToPop.push(stackedToWrap);
+
 		/*
 		 ****************************************************************
 		 **************************************************************** 
@@ -702,458 +683,460 @@
 		 ****************************************************************
 		 ****************************************************************
 		 */
-        for (int i = 0; i < node.getChildCount(); i++) {
-            Tree child = node.getChild(i);
-            processNode(child);
-        }
-		
+		for (int i = 0; i < node.getChildCount(); i++) {
+			Tree child = node.getChild(i);
+			processNode(child);
+		}
+
 		/*
 		 **************************************************************
 		 * Stuff that happens after processing the children of a node *
 		 **************************************************************
 		 */
 
-        // remove sequence from object stack if node is implicitly sequenced
-        if (sequencedNodes.size() > 0) {
-            if (node == sequencedNodes.getFirst()) {
-                objectStack.pop();
-                sequencedNodes.pop();
-            }
-        }
+		// remove sequence from object stack if node is implicitly sequenced
+		if (sequencedNodes.size() > 0) {
+			if (node == sequencedNodes.getFirst()) {
+				objectStack.pop();
+				sequencedNodes.pop();
+			}
+		}
 
-        for (int i = 0; i < objectsToPop.get(0); i++) {
-            objectStack.pop();
-        }
-        objectsToPop.pop();
-        
-        
-//        if (!toWrapStack.isEmpty()) System.err.println(toWrapStack.get(0)[0]);
-        for (int i = 0; i < toWrapsToPop.get(0); i++) {
-            putIntoSuperObject(wrap(toWrapStack.pop()));
-        }
-        toWrapsToPop.pop();
+		for (int i = 0; i < objectsToPop.get(0); i++) {
+			objectStack.pop();
+		}
+		objectsToPop.pop();
 
-        if (nodeCat.equals("ARG2") && openNodeCats.get(1).equals("OPNOT")) {
-            negate = false;
-        }
-        
-        if (nodeCat.equals("OPALL")) {
-        	inOPALL = false;
-        }
-        
-        openNodeCats.pop();
-    }
 
-    private void processSpanDistance(String meas, int min, int max) {
+		//        if (!toWrapStack.isEmpty()) System.err.println(toWrapStack.get(0)[0]);
+		for (int i = 0; i < toWrapsToPop.get(0); i++) {
+			putIntoSuperObject(wrap(toWrapStack.pop()));
+		}
+		toWrapsToPop.pop();
+
+		if (nodeCat.equals("ARG2") && openNodeCats.get(1).equals("OPNOT")) {
+			negate = false;
+		}
+
+		if (nodeCat.equals("OPALL")) {
+			inOPALL = false;
+		}
+
+		openNodeCats.pop();
+	}
+
+	private void processSpanDistance(String meas, int min, int max) {
 		// TODO Do stuff here in case we'll decide one day to treat span distances in a special way.
 	}
 
 	/**
-     * Registers an entry in the {@link #operandWrap} table in order to allow an operator's arguments
-     * (or only one of them) to be wrapped in a class group.
-     * @param node The operator node (parent node of the ARG1/ARG2 node)
-     * @param arg The argument number (1 or 2)
-     * @param cls The class id.
-     */
-    private void wrapOperandInClass(Tree node, int arg, int cls) {
-    	LinkedHashMap<String,Object> clsGroup = makeSpanClass(cls);
+	 * Registers an entry in the {@link #operandWrap} table in order to allow an operator's arguments
+	 * (or only one of them) to be wrapped in a class group.
+	 * @param node The operator node (parent node of the ARG1/ARG2 node)
+	 * @param arg The argument number (1 or 2)
+	 * @param cls The class id.
+	 */
+	private void wrapOperandInClass(Tree node, int arg, int cls) {
+		LinkedHashMap<String,Object> clsGroup = makeSpanClass(cls);
 		wrapOperand(node,arg,clsGroup);
 	}
 
-    /**
-     * Registers an entry in the {@link #operandWrap} table in order to allow an operator's arguments
-     * (or only one of them) to be wrapped in an arbitrary object, e.g. a reference group.
-     * @param node The operator node (parent node of the ARG1/ARG2 node)
-     * @param arg The argument number (1 or 2)
-     * @param container The object in whose operand list the argument shall be wrapped.
-     */
-    private void wrapOperand(Tree node, int arg, LinkedHashMap<String, Object> container) {
-    	operandWrap.put(node, arg, container);
-  	}
+	/**
+	 * Registers an entry in the {@link #operandWrap} table in order to allow an operator's arguments
+	 * (or only one of them) to be wrapped in an arbitrary object, e.g. a reference group.
+	 * @param node The operator node (parent node of the ARG1/ARG2 node)
+	 * @param arg The argument number (1 or 2)
+	 * @param container The object in whose operand list the argument shall be wrapped.
+	 */
+	private void wrapOperand(Tree node, int arg, LinkedHashMap<String, Object> container) {
+		operandWrap.put(node, arg, container);
+	}
 
 	private Object translateMorph(String layer) {
-        // todo: not very nicely solved! Does this require extension somehow? if not, why not use simple string comparison?!
-//        LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
-//        map.put("ANA", "pos");
-//        if (map.containsKey(layer))
-//            return map.get(layer);
-//        else
-//            return layer;
-        if (layer.equals("ANA"))
-            return ResourceMapper.descriptor2policy("ANA");
-        else
-            return layer;
+		// todo: not very nicely solved! Does this require extension somehow? if not, why not use simple string comparison?!
+		//        LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
+		//        map.put("ANA", "pos");
+		//        if (map.containsKey(layer))
+		//            return map.get(layer);
+		//        else
+		//            return layer;
+		if (layer.equals("ANA"))
+			return ResourceMapper.descriptor2policy("ANA");
+		else
+			return layer;
 
-    }
+	}
 
-    @SuppressWarnings("unchecked")
+	@SuppressWarnings("unchecked")
 	private LinkedHashMap<String, Object> parseOPINOptions(Tree node) {
-        Tree posnode = getFirstChildWithCat(node, "POS");
-        Tree rangenode = getFirstChildWithCat(node, "RANGE");
-        Tree exclnode = getFirstChildWithCat(node, "EXCL");
-        Tree groupnode = getFirstChildWithCat(node, "GROUP");
-        boolean negatePosition = false;
-        LinkedHashMap<String, Object> posOptions = new LinkedHashMap<String, Object>();
-        ArrayList<String> positions = new ArrayList<String>();
-        ArrayList<String> classRefCheck = new ArrayList<String>();
-        posOptions.put("matchall", false);
-        String frame = "";
-        String posOption = null; 
-        if (posnode != null) {
-            posOption = posnode.getChild(0).toStringTree();
-            switch (posOption) {
-            case "L":
-                positions.add("frames:startswith");
-                classRefCheck.add("classRefCheck:includes");
-                frame = "startswith";
-                break;
-            case "R":
-            	positions.add("frames:endswith");
-                classRefCheck.add("classRefCheck:includes");
-                frame = "endswith";
-                break;
-            case "F":
-            	positions.add("frames:matches");
-                classRefCheck.add("classRefCheck:includes");
-                frame = "matches";
-                break;
-            case "FE":
-            	positions.add("frames:matches");
-                classRefCheck.add("classRefCheck:equals");
-                frame = "matches";
-                break;
-            case "FI":
-            	positions.add("frames:matches");
-            	classRefCheck.add("classRefCheck:unequals");
-                classRefCheck.add("classRefCheck:includes");
-                frame = "matches-noident";
-                break;
-            case "N": 
-            	positions.add("frames:contains");
-                classRefCheck.add("classRefCheck:includes");
-                frame = "contains";
-                break;
-            }
-        } else {
-        	classRefCheck.add("classRefCheck:includes");
-        	frame = "contains";
-        }
-        posOptions.put("frames", positions);
-        posOptions.put("classRefCheck", classRefCheck);
-        posOptions.put("frame", "frame:"+frame);
-        announcements.add("Deprecated 2014-09-22: 'frame' only to be supported until 3 months from deprecation date. " +
+		Tree posnode = getFirstChildWithCat(node, "POS");
+		Tree rangenode = getFirstChildWithCat(node, "RANGE");
+		Tree exclnode = getFirstChildWithCat(node, "EXCL");
+		Tree groupnode = getFirstChildWithCat(node, "GROUP");
+		boolean negatePosition = false;
+		LinkedHashMap<String, Object> posOptions = new LinkedHashMap<String, Object>();
+		ArrayList<String> positions = new ArrayList<String>();
+		ArrayList<String> classRefCheck = new ArrayList<String>();
+		posOptions.put("matchall", false);
+		String frame = "";
+		String posOption = null; 
+		if (posnode != null) {
+			posOption = posnode.getChild(0).toStringTree();
+			switch (posOption) {
+			case "L":
+				positions.add("frames:startswith");
+				classRefCheck.add("classRefCheck:includes");
+				frame = "startswith";
+				break;
+			case "R":
+				positions.add("frames:endswith");
+				classRefCheck.add("classRefCheck:includes");
+				frame = "endswith";
+				break;
+			case "F":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:includes");
+				frame = "matches";
+				break;
+			case "FE":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:equals");
+				frame = "matches";
+				break;
+			case "FI":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:unequals");
+				classRefCheck.add("classRefCheck:includes");
+				frame = "matches-noident";
+				break;
+			case "N": 
+				positions.add("frames:contains");
+				classRefCheck.add("classRefCheck:includes");
+				frame = "contains";
+				break;
+			}
+		} else {
+			classRefCheck.add("classRefCheck:includes");
+			frame = "contains";
+		}
+		posOptions.put("frames", positions);
+		posOptions.put("classRefCheck", classRefCheck);
+		posOptions.put("frame", "frame:"+frame);
+		announcements.add("Deprecated 2014-09-22: 'frame' only to be supported until 3 months from deprecation date. " +
 				"Position frames are now expressed through 'frames' and 'sharedClasses'");
-        
-        if (exclnode != null) {
-            if (exclnode.getChild(0).toStringTree().equals("YES")) {
-                negatePosition = !negatePosition;
-            }
-        }
-        
-        if (rangenode != null) {
-            String range = rangenode.getChild(0).toStringTree().toLowerCase();
-            if (range.equals("all")) {
-            	posOptions.put("matchall", true);
-//            	LinkedHashMap<String,Object> ref = makeResetReference(); // reset all defined classes
-//            	wrapOperand(node,2,ref);
-            }
-        }
 
-        if (negatePosition) {
-        	posOptions.put("exclude", "true");
-        }
+		if (exclnode != null) {
+			if (exclnode.getChild(0).toStringTree().equals("YES")) {
+				negatePosition = !negatePosition;
+			}
+		}
 
-        if (groupnode != null) {
-            String grouping = groupnode.getChild(0).toStringTree().equals("max") ? "true" : "false";
-            posOptions.put("grouping", grouping);
-        }
-        return posOptions;
-    }
+		if (rangenode != null) {
+			String range = rangenode.getChild(0).toStringTree().toLowerCase();
+			if (range.equals("all")) {
+				posOptions.put("matchall", true);
+				//            	LinkedHashMap<String,Object> ref = makeResetReference(); // reset all defined classes
+				//            	wrapOperand(node,2,ref);
+			}
+		}
 
-  
+		if (negatePosition) {
+			posOptions.put("exclude", "true");
+		}
+
+		if (groupnode != null) {
+			String grouping = groupnode.getChild(0).toStringTree().equals("max") ? "true" : "false";
+			posOptions.put("grouping", grouping);
+		}
+		return posOptions;
+	}
+
+
 
 	private LinkedHashMap<String, Object> parseOPOVOptions(Tree node) {
-    	boolean negatePosition = false;
-        Tree posnode = getFirstChildWithCat(node, "POS");
-        Tree rangenode = getFirstChildWithCat(node, "RANGE");
-        Tree exclnode = getFirstChildWithCat(node, "EXCL");
-        Tree groupnode = getFirstChildWithCat(node, "GROUP");
-        LinkedHashMap<String, Object> posOptions = new LinkedHashMap<String, Object>();
-        ArrayList<String> positions = new ArrayList<String>();
-        ArrayList<String> classRefCheck = new ArrayList<String>();
-        posOptions.put("matchall", false);
-        String frame = "";
-        String posOption = null; 
-        if (posnode != null) {
-            posOption = posnode.getChild(0).toStringTree();
-            switch (posOption) {
-            case "L":
-                positions.add("frames:startswith");
-                positions.add("frames:overlapsLeft");
-                classRefCheck.add("classRefCheck:intersects");
-                frame = "overlapsLeft";
-                break;
-            case "R":
-            	positions.add("frames:endswith");
-            	positions.add("frames:overlapsRight");
-                classRefCheck.add("classRefCheck:intersects");
-                frame = "overlapsRight";
-                break;
-            case "F":
-            	positions.add("frames:matches");
-                classRefCheck.add("classRefCheck:intersects");
-                frame = "matches";
-                break;
-            case "FE":
-            	positions.add("frames:matches");
-                classRefCheck.add("classRefCheck:equals");
-                frame = "matches";
-                break;
-            case "FI":
-            	positions.add("frames:matches");
-            	classRefCheck.add("classRefCheck:unequals");
-            	frame = "matches-noident";
-                break;
-            case "X": 
-            	positions.add("frames:contains");
-                classRefCheck.add("classRefCheck:intersects");
-                frame = "overlaps";
-                break;
-            }
-        } else {
-        	classRefCheck.add("classRefCheck:intersects");
-        	frame = "overlaps";
-        }
-        
-        posOptions.put("frames", positions);
-        posOptions.put("classRefCheck", classRefCheck);
-        posOptions.put("frame", "frame:"+frame);
-        announcements.add("Deprecated 2014-09-22: 'frame' only to be supported until 3 months from deprecation date. " +
+		boolean negatePosition = false;
+		Tree posnode = getFirstChildWithCat(node, "POS");
+		Tree rangenode = getFirstChildWithCat(node, "RANGE");
+		Tree exclnode = getFirstChildWithCat(node, "EXCL");
+		Tree groupnode = getFirstChildWithCat(node, "GROUP");
+		LinkedHashMap<String, Object> posOptions = new LinkedHashMap<String, Object>();
+		ArrayList<String> positions = new ArrayList<String>();
+		ArrayList<String> classRefCheck = new ArrayList<String>();
+		posOptions.put("matchall", false);
+		String frame = "";
+		String posOption = null; 
+		if (posnode != null) {
+			posOption = posnode.getChild(0).toStringTree();
+			switch (posOption) {
+			case "L":
+				positions.add("frames:startswith");
+				positions.add("frames:overlapsLeft");
+				classRefCheck.add("classRefCheck:intersects");
+				frame = "overlapsLeft";
+				break;
+			case "R":
+				positions.add("frames:endswith");
+				positions.add("frames:overlapsRight");
+				classRefCheck.add("classRefCheck:intersects");
+				frame = "overlapsRight";
+				break;
+			case "F":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:intersects");
+				frame = "matches";
+				break;
+			case "FE":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:equals");
+				frame = "matches";
+				break;
+			case "FI":
+				positions.add("frames:matches");
+				classRefCheck.add("classRefCheck:unequals");
+				frame = "matches-noident";
+				break;
+			case "X": 
+				positions.add("frames:contains");
+				classRefCheck.add("classRefCheck:intersects");
+				frame = "overlaps";
+				break;
+			}
+		} else {
+			classRefCheck.add("classRefCheck:intersects");
+			frame = "overlaps";
+		}
+
+		posOptions.put("frames", positions);
+		posOptions.put("classRefCheck", classRefCheck);
+		posOptions.put("frame", "frame:"+frame);
+		announcements.add("Deprecated 2014-09-22: 'frame' only to be supported until 3 months from deprecation date. " +
 				"Position frames are now expressed through 'frames' and 'sharedClasses'");
 
-        if (exclnode != null) {
-            if (exclnode.getChild(0).toStringTree().equals("YES")) {
-                negatePosition = !negatePosition;
-            }
-        }
-        
-        if (rangenode != null) {
-            String range = rangenode.getChild(0).toStringTree().toLowerCase();
-            if (range.equals("all")) {
-            	posOptions.put("matchall", true);
-//            	LinkedHashMap<String,Object> ref = makeResetReference(); // reset all defined classes
-//            	wrapOperand(node,2,ref);
-            }
-        }
+		if (exclnode != null) {
+			if (exclnode.getChild(0).toStringTree().equals("YES")) {
+				negatePosition = !negatePosition;
+			}
+		}
 
-        if (negatePosition) {
-        	posOptions.put("exclude", "true");
-        }
+		if (rangenode != null) {
+			String range = rangenode.getChild(0).toStringTree().toLowerCase();
+			if (range.equals("all")) {
+				posOptions.put("matchall", true);
+				//            	LinkedHashMap<String,Object> ref = makeResetReference(); // reset all defined classes
+				//            	wrapOperand(node,2,ref);
+			}
+		}
 
-        if (groupnode != null) {
-            String grouping = groupnode.getChild(0).toStringTree().equals("max") ? "true" : "false";
-            posOptions.put("grouping", grouping);
-        }
-        return posOptions;
-    }
+		if (negatePosition) {
+			posOptions.put("exclude", "true");
+		}
 
-    @SuppressWarnings({ "unchecked" })
+		if (groupnode != null) {
+			String grouping = groupnode.getChild(0).toStringTree().equals("max") ? "true" : "false";
+			posOptions.put("grouping", grouping);
+		}
+		return posOptions;
+	}
+
+	@SuppressWarnings({ "unchecked" })
 	private LinkedHashMap<String,Object> wrap(LinkedHashMap[] wrapCascade) {
-    	int i;
-    	for (i=0; i<wrapCascade.length-1; i++) {
-    		ArrayList<Object> containerOperands = (ArrayList<Object>) wrapCascade[i+1].get("operands");
-    		containerOperands.add(0,wrapCascade[i]);
-    	}
-    	return wrapCascade[i];
-    }
-    
-    private LinkedHashMap<String,Object> processPositionOption(String posOption) {
-    	LinkedHashMap<String,Object> posgroup = null;
+		int i;
+		for (i=0; i<wrapCascade.length-1; i++) {
+			ArrayList<Object> containerOperands = (ArrayList<Object>) wrapCascade[i+1].get("operands");
+			containerOperands.add(0,wrapCascade[i]);
+		}
+		return wrapCascade[i];
+	}
 
-    	if (posOption.equals("F") || posOption.equals("FI")) {
-    		posgroup = makePosition("startswith");
-    		LinkedHashMap<String, Object> endsWithPosition = makePosition("endswith");
-    		((ArrayList<Object>) endsWithPosition.get("operands")).add(makeReference(classCounter+1));
-    		LinkedHashMap<String,Object> innerFocus = makeReference(classCounter);
-    		innerFocus.put("operands", new ArrayList<Object>());
-    		LinkedHashMap<String,Object> outerFocus = makeReference(classCounter);
-    		outerFocus.put("operands", new ArrayList<Object>());
-    		LinkedHashMap[] toWrap = new LinkedHashMap[]{posgroup, innerFocus, endsWithPosition, outerFocus};
-    		if (posOption.equals("FI")) {
-    			LinkedHashMap<String, Object> noMatchPosition = makePosition("matches");
-    			((ArrayList<Object>) noMatchPosition.get("operands")).add(makeReference(classCounter+1));
-    			noMatchPosition.put("exclude", true);
-    			LinkedHashMap<String,Object> outermostFocus = makeReference(classCounter);
-    			outermostFocus.put("operands", new ArrayList<Object>());
-    			toWrap = new LinkedHashMap[]{posgroup, innerFocus, endsWithPosition, outerFocus, noMatchPosition, outermostFocus};
-    		}
+	private LinkedHashMap<String,Object> processPositionOption(String posOption) {
+		LinkedHashMap<String,Object> posgroup = null;
 
-    		toWrapStack.push(toWrap);
-    		stackedToWrap++;
-//    		wrapOperandInClass(node,1,classCounter+1);
-//    		wrapOperandInClass(node,2,classCounter);
-//    		wrapFirstOpInClass = classCounter+1;
-//    		wrapSecondOpInClass = classCounter;
-    	}
-    	
-    	return posgroup;
-    }
-    
-//    /**
-//     * Translates the text area specifications (position option arguments) to terms used in serialisation.
-//     * For the allowed argument types and their values for OPIN and OPOV, see
-//     * http://www.ids-mannheim.de/cosmas2/win-app/hilfe/suchanfrage/eingabe-grafisch/syntax/ARGUMENT_I.html or
-//     * http://www.ids-mannheim.de/cosmas2/win-app/hilfe/suchanfrage/eingabe-grafisch/syntax/ARGUMENT_O.html, respectively.
-//     *
-//     * @param argument
-//     * @param mode
-//     * @return
-//     */
-//    private ArrayList<String> translateTextAreaArgument(String argument, String mode) {
-//    	ArrayList<String> positions = new ArrayList<String>();
-//        // POSTYP	:	'L'|'l'|'R'|'r'|'F'|'f'|'FE'|'fe'|'FI'|'fi'|'N'|'n'|'X'|'x' ;
-//        argument = argument.toUpperCase();
-//        switch (argument) {
-//            case "L":
-//                if (mode.equals("in")) positions.add("startswith");
-//                break;
-//            case "R":
-//                positions = mode.equals("in") ? "endswith" : "overlapsRight";
-//                break;
-//            case "F":
-//                positions = "startswith";
-//                break;
-//            case "FE":
-//                positions = "matches";
-//                break;
-//            case "FI":
-//                positions = "startswith";
-//                break;
-//            case "N": // for OPIN only - exclusion constraint formulated in parseOPINOptions
-//                positions = "leftrightmatch";
-//                break;
-//            case "X": // for OPOV only
-//                positions = "residual";
-//                break;
-//        }
-//        return positions;
-//    }
+		if (posOption.equals("F") || posOption.equals("FI")) {
+			posgroup = makePosition("startswith");
+			LinkedHashMap<String, Object> endsWithPosition = makePosition("endswith");
+			((ArrayList<Object>) endsWithPosition.get("operands")).add(makeReference(classCounter+1));
+			LinkedHashMap<String,Object> innerFocus = makeReference(classCounter);
+			innerFocus.put("operands", new ArrayList<Object>());
+			LinkedHashMap<String,Object> outerFocus = makeReference(classCounter);
+			outerFocus.put("operands", new ArrayList<Object>());
+			LinkedHashMap[] toWrap = new LinkedHashMap[]{posgroup, innerFocus, endsWithPosition, outerFocus};
+			if (posOption.equals("FI")) {
+				LinkedHashMap<String, Object> noMatchPosition = makePosition("matches");
+				((ArrayList<Object>) noMatchPosition.get("operands")).add(makeReference(classCounter+1));
+				noMatchPosition.put("exclude", true);
+				LinkedHashMap<String,Object> outermostFocus = makeReference(classCounter);
+				outermostFocus.put("operands", new ArrayList<Object>());
+				toWrap = new LinkedHashMap[]{posgroup, innerFocus, endsWithPosition, outerFocus, noMatchPosition, outermostFocus};
+			}
 
-    LinkedList<ArrayList<Object>> nestedDistOperands = new LinkedList<ArrayList<Object>>();  
-    
-    @SuppressWarnings("unchecked")
-    private void putIntoSuperObject(LinkedHashMap<String, Object> object, int objStackPosition) {
+			toWrapStack.push(toWrap);
+			stackedToWrap++;
+			//    		wrapOperandInClass(node,1,classCounter+1);
+			//    		wrapOperandInClass(node,2,classCounter);
+			//    		wrapFirstOpInClass = classCounter+1;
+			//    		wrapSecondOpInClass = classCounter;
+		}
+
+		return posgroup;
+	}
+
+	//    /**
+	//     * Translates the text area specifications (position option arguments) to terms used in serialisation.
+	//     * For the allowed argument types and their values for OPIN and OPOV, see
+	//     * http://www.ids-mannheim.de/cosmas2/win-app/hilfe/suchanfrage/eingabe-grafisch/syntax/ARGUMENT_I.html or
+	//     * http://www.ids-mannheim.de/cosmas2/win-app/hilfe/suchanfrage/eingabe-grafisch/syntax/ARGUMENT_O.html, respectively.
+	//     *
+	//     * @param argument
+	//     * @param mode
+	//     * @return
+	//     */
+	//    private ArrayList<String> translateTextAreaArgument(String argument, String mode) {
+	//    	ArrayList<String> positions = new ArrayList<String>();
+	//        // POSTYP	:	'L'|'l'|'R'|'r'|'F'|'f'|'FE'|'fe'|'FI'|'fi'|'N'|'n'|'X'|'x' ;
+	//        argument = argument.toUpperCase();
+	//        switch (argument) {
+	//            case "L":
+	//                if (mode.equals("in")) positions.add("startswith");
+	//                break;
+	//            case "R":
+	//                positions = mode.equals("in") ? "endswith" : "overlapsRight";
+	//                break;
+	//            case "F":
+	//                positions = "startswith";
+	//                break;
+	//            case "FE":
+	//                positions = "matches";
+	//                break;
+	//            case "FI":
+	//                positions = "startswith";
+	//                break;
+	//            case "N": // for OPIN only - exclusion constraint formulated in parseOPINOptions
+	//                positions = "leftrightmatch";
+	//                break;
+	//            case "X": // for OPOV only
+	//                positions = "residual";
+	//                break;
+	//        }
+	//        return positions;
+	//    }
+
+	LinkedList<ArrayList<Object>> nestedDistOperands = new LinkedList<ArrayList<Object>>();  
+
+	@SuppressWarnings("unchecked")
+	private void putIntoSuperObject(LinkedHashMap<String, Object> object, int objStackPosition) {
 		if (objectStack.size() > objStackPosition) {
-    		ArrayList<Object> topObjectOperands = (ArrayList<Object>) objectStack.get(objStackPosition).get("operands");
-    		if (!invertedOperandsLists.contains(topObjectOperands)) {
-    			topObjectOperands.add(object);
-    		} else {
-    			topObjectOperands.add(0, object);
-    		}
+			ArrayList<Object> topObjectOperands = (ArrayList<Object>) objectStack.get(objStackPosition).get("operands");
+			if (!invertedOperandsLists.contains(topObjectOperands)) {
+				topObjectOperands.add(object);
+			} else {
+				topObjectOperands.add(0, object);
+			}
 
-    	} else {
-    		requestMap.put("query", object);
-    	}
-    }
+		} else {
+			requestMap.put("query", object);
+		}
+	}
 
-    private void putIntoSuperObject(LinkedHashMap<String, Object> object) {
-        putIntoSuperObject(object, 0);
-    }
+	private void putIntoSuperObject(LinkedHashMap<String, Object> object) {
+		putIntoSuperObject(object, 0);
+	}
 
 
-    private Tree parseCosmasQuery(String q) throws RecognitionException {
-        q = rewritePositionQuery(q);
-    	
-        Tree tree = null;
-        ANTLRStringStream ss = new ANTLRStringStream(q);
-        c2psLexer lex = new c2psLexer(ss);
-        org.antlr.runtime.CommonTokenStream tokens = new org.antlr.runtime.CommonTokenStream(lex);  //v3
-        parser = new c2psParser(tokens);
-        c2psParser.c2ps_query_return c2Return = ((c2psParser) parser).c2ps_query();  // statt t().
-        // AST Tree anzeigen:
-        tree = (Tree) c2Return.getTree();
+	private Tree parseCosmasQuery(String q) throws RecognitionException {
+		q = rewritePositionQuery(q);
 
-        String treestring = tree.toStringTree();
-        if (treestring.contains("<mismatched token") || treestring.contains("<error") || treestring.contains("<unexpected")) {
-            log.error("Invalid tree. Could not parse Cosmas query. Make sure it is well-formed.");
-            throw new RecognitionException();
-        }
+		Tree tree = null;
+		ANTLRStringStream ss = new ANTLRStringStream(q);
+		c2psLexer lex = new c2psLexer(ss);
+		org.antlr.runtime.CommonTokenStream tokens = new org.antlr.runtime.CommonTokenStream(lex);  //v3
+		parser = new c2psParser(tokens);
+		c2psParser.c2ps_query_return c2Return = ((c2psParser) parser).c2ps_query();  // statt t().
+		// AST Tree anzeigen:
+		tree = (Tree) c2Return.getTree();
 
-        return tree;
-    }
+		String treestring = tree.toStringTree();
+		if (treestring.contains("<mismatched token") || treestring.contains("<error") || treestring.contains("<unexpected")) {
+			log.error("Invalid tree. Could not parse Cosmas query. Make sure it is well-formed.");
+			throw new RecognitionException();
+		}
 
-    /**
-     * Normalises position operators to equivalents using #BED  
-     */
-    private String rewritePositionQuery(String q) {
-    	Pattern p = Pattern.compile("(\\w+):((\\+|-)?(sa|se|pa|pe|ta|te),?)+");
-        Matcher m = p.matcher(q);
-      
-        String rewrittenQuery = q;
-        while (m.find()) {
-            String match = m.group();
-            String conditionsString = match.split(":")[1];
-            Pattern conditionPattern = Pattern.compile("(\\+|-)?(sa|se|pa|pe|ta|te)");
-            Matcher conditionMatcher = conditionPattern.matcher(conditionsString);
-            String replacement = "#BED(" + m.group(1) + " , ";
-            while (conditionMatcher.find()) {
-                replacement = replacement + conditionMatcher.group() + ",";
-            }
-            replacement = replacement.substring(0, replacement.length() - 1) + ")"; //remove trailing comma and close parenthesis
-            rewrittenQuery = rewrittenQuery.replace(match, replacement);
-        }
-        return rewrittenQuery;
+		return tree;
 	}
 
 	/**
-     * @param args
-     */
-    public static void main(String[] args) {
+	 * Normalises position operators to equivalents using #BED  
+	 */
+	private String rewritePositionQuery(String q) {
+		Pattern p = Pattern.compile("(\\w+):((\\+|-)?(sa|se|pa|pe|ta|te),?)+");
+		Matcher m = p.matcher(q);
+
+		String rewrittenQuery = q;
+		while (m.find()) {
+			String match = m.group();
+			String conditionsString = match.split(":")[1];
+			Pattern conditionPattern = Pattern.compile("(\\+|-)?(sa|se|pa|pe|ta|te)");
+			Matcher conditionMatcher = conditionPattern.matcher(conditionsString);
+			String replacement = "#BED(" + m.group(1) + " , ";
+			while (conditionMatcher.find()) {
+				replacement = replacement + conditionMatcher.group() + ",";
+			}
+			replacement = replacement.substring(0, replacement.length() - 1) + ")"; //remove trailing comma and close parenthesis
+			rewrittenQuery = rewrittenQuery.replace(match, replacement);
+		}
+		return rewrittenQuery;
+	}
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
 		/*
 		 * For debugging
 		 */
-        String[] queries = new String[]{
+		String[] queries = new String[]{
 				/* COSMAS 2 */
-//                "wegen #OV(x) <s>",
-//                "wegen #IN(L) <s>",
-//                "#NHIT(gehen /w1:10 voran)",
-//                "wegen #OV(FI) <s>",
-//                "Sonne /+w4 Mond",
-//                "#BEG(der /w3:5 Mann) /+w10 kommt",
-//                "Sonne /s0 Mond"
-//                "Sonne /+w4 Mond",
-//                "#BED(der Mann , sa,-pa)",
-//        		"Sonne /+w1:4 Mond /-w1:7 Sterne",
-//        		"wegen #IN('FE,ALL,%,MIN') <s>",
-//        		"#NHIT(gehen /w1:10 voran)"
-//        		"MORPH(V PRES IND)",
-//                "wegen #OV(F) <s>"
-//        		"Sonne /s0 Mond",
-        		"Sonne /+w1:4 Mond /-w1:7 Sterne",
-        		"Der:ta",
-        		"&mond-",
-        		"gehen /+w10 voran %w10 Beispiel",
-        		"(gehen /+w10 voran) %w10 Beispiel",
-        		"#BED(der Mann , sa,-pa)"
-        };
-//		CosmasTree.verbose=true;
-        for (String q : queries) {
-            try {
-                System.out.println(q);
-                try {
-                    CosmasTree act = new CosmasTree(q);
-                    System.out.println(act.parseCosmasQuery(q).toStringTree());
-                } catch (QueryException e) {
-                    e.printStackTrace();
-                } catch (RecognitionException e) {
-                    e.printStackTrace();
-                }
-                System.out.println();
+				//                "wegen #OV(x) <s>",
+				//                "wegen #IN(L) <s>",
+				//                "#NHIT(gehen /w1:10 voran)",
+				//                "wegen #OV(FI) <s>",
+				//                "Sonne /+w4 Mond",
+				//                "#BEG(der /w3:5 Mann) /+w10 kommt",
+				//                "Sonne /s0 Mond"
+				//                "Sonne /+w4 Mond",
+				//                "#BED(der Mann , sa,-pa)",
+				//        		"Sonne /+w1:4 Mond /-w1:7 Sterne",
+				//        		"wegen #IN('FE,ALL,%,MIN') <s>",
+				//        		"#NHIT(gehen /w1:10 voran)"
+				//        		"MORPH(V PRES IND)",
+				//                "wegen #OV(F) <s>"
+				//        		"Sonne /s0 Mond",
+				"Sonne /+w1:4 Mond /-w1:7 Sterne",
+				"Der:ta",
+				"&mond-",
+				"gehen /+w10 voran %w10 Beispiel",
+				"(gehen /+w10 voran) %w10 Beispiel",
+				"#BED(der Mann , sa,-pa)",
+				"MORPH(foundry/layer=key)",
+				"MORPH(f/l!=k &f/l!=k)",
+		};
+		//		CosmasTree.verbose=true;
+		for (String q : queries) {
+			try {
+				System.out.println(q);
+				try {
+					CosmasTree act = new CosmasTree(q);
+					System.out.println(act.parseCosmasQuery(q).toStringTree());
+				} catch (QueryException e) {
+					e.printStackTrace();
+				} catch (RecognitionException e) {
+					e.printStackTrace();
+				}
+				System.out.println();
 
-            } catch (NullPointerException npe) {
-                npe.printStackTrace();
-                System.out.println("null\n");
-            }
-        }
-    }
+			} catch (NullPointerException npe) {
+				npe.printStackTrace();
+				System.out.println("null\n");
+			}
+		}
+	}
 }
\ No newline at end of file
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
index 8124abc..bb78e03 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
@@ -20,6 +20,7 @@
 public class PoliqarpPlusTree extends Antlr4AbstractSyntaxTree {
 
 	private static Logger log = LoggerFactory.getLogger(PoliqarpPlusTree.class);
+	private int classCounter = 1024;
 
 	/**
 	 * Most centrally, this class maintains a set of nested maps and lists which represent the JSON tree, which is built by the JSON serialiser
@@ -101,7 +102,7 @@
 		if (nodeCat.equals("sequence")) {
 			LinkedHashMap<String,Object> sequence = makeGroup("sequence");
 			ParseTree distanceNode = getFirstChildWithCat(node, "distance");
-			
+
 			if (distanceNode!=null) {
 				Integer[] minmax = parseDistance(distanceNode);
 				LinkedHashMap<String,Object> distance = makeDistance("w", minmax[0], minmax[1]);
@@ -115,7 +116,7 @@
 			objectStack.push(sequence);
 			stackedObjects++;
 		}
-		
+
 		/*
 		 * empty tokens at beginning/end of sequence
 		 */
@@ -134,7 +135,7 @@
 			objectStack.push(object);
 			stackedObjects++;
 		}
-		
+
 		if (nodeCat.equals("emptyTokenSequenceClass")) {
 			Integer[] minmax = parseDistance(node);
 			int classId = 0;
@@ -146,7 +147,7 @@
 			objectStack.push(classGroup);
 			stackedObjects++;
 		}
-		
+
 
 		if (nodeCat.equals("token")) {
 			LinkedHashMap<String,Object> token = makeToken();
@@ -158,7 +159,7 @@
 			if (getNodeCat(node.getChild(0)).equals("key")) {
 				// no 'term' child, but direct key specification: process here
 				LinkedHashMap<String,Object> term = makeTerm();
-				
+
 				String key = node.getChild(0).getText();
 				if (getNodeCat(node.getChild(0).getChild(0)).equals("regex")) {
 					isRegex = true;
@@ -196,10 +197,23 @@
 		}
 
 		if (nodeCat.equals("alignment")) {
-			LinkedHashMap<String,Object> aligned = makeGroup("alignment");
-			aligned.put("align", "align:left");
-			putIntoSuperObject(aligned);
-			objectStack.push(aligned);
+			LinkedHashMap<String,Object> alignClass = makeSpanClass(++classCounter,false);
+			LinkedHashMap<String,Object> metaMap = (LinkedHashMap<String, Object>) requestMap.get("meta");
+			if (metaMap.containsKey("alignment")) {
+				ArrayList<Integer> alignedClasses = new ArrayList<Integer>();
+				try {
+					alignedClasses = (ArrayList<Integer>) metaMap.get("alignment"); 
+				} catch (ClassCastException cce) {
+					alignedClasses.add((Integer) metaMap.get("alignment"));
+				}
+				alignedClasses.add(classCounter);
+				metaMap.put("alignment", alignedClasses);
+			} else {
+				metaMap.put("alignment", classCounter);
+			}
+
+			putIntoSuperObject(alignClass);
+			objectStack.push(alignClass);
 			stackedObjects++;
 		}
 
@@ -281,7 +295,7 @@
 			objectStack.push(relationGroup);
 			stackedObjects++;
 		}
-		
+
 		if (nodeCat.equals("spanclass")) {
 			// Step I: get info
 			int classId = 0;
@@ -371,7 +385,7 @@
 			stackedObjects++;
 			visited.add(node.getChild(0));
 		}
-		
+
 		if (nodeCat.equals("meta")) {
 			LinkedHashMap<String, Object> metaFilter = new LinkedHashMap<String, Object>();
 			requestMap.put("meta", metaFilter);
@@ -455,26 +469,26 @@
 	private LinkedHashMap<String,Object> parseFrame(ParseTree node) {
 		String operator = node.toStringTree(parser).toLowerCase();
 		String[] frames = new String[]{""};
-		String[] sharedClasses = new String[]{"sharedClasses:includes"};
+		String[] classRefCheck = new String[]{"classRefCheck:includes"};
 		switch (operator) {
-			case "contains":
-				frames = new String[]{};
-				break;
-			case "matches":
-				frames = new String[]{"frame:matches"};
-				break;
-			case "startswith":
-				frames = new String[]{"frame:startswith"};
-				break;
-			case "endswith":
-				frames = new String[]{"frame:endswith"};
-				break;	
-			case "overlaps":
-				frames = new String[]{"frame:overlapsLeft","frame:overlapsRight"};
-				sharedClasses = new String[]{"sharedClasses:intersects"};
-				break;
+		case "contains":
+			frames = new String[]{"frames:contains"};
+			break;
+		case "matches":
+			frames = new String[]{"frames:matches"};
+			break;
+		case "startswith":
+			frames = new String[]{"frames:startswith"};
+			break;
+		case "endswith":
+			frames = new String[]{"frames:endswith"};
+			break;	
+		case "overlaps":
+			frames = new String[]{"frames:overlapsLeft","frames:overlapsRight"};
+			classRefCheck = new String[]{"classRefCheck:intersects"};
+			break;
 		}
-		return makePosition(frames,sharedClasses);
+		return makePosition(frames,classRefCheck);
 	}
 
 
@@ -482,7 +496,7 @@
 			ParseTree node, boolean negated) {
 		return parseTermOrTermGroup(node, negated, "token");
 	}
-	
+
 	/**
 	 * Parses a (term) or (termGroup) node
 	 * @param node
@@ -611,11 +625,11 @@
 		Integer max = minmax[1];
 		min++;
 		if (max != null) max++;
-//		min = cropToMaxValue(min);
-//		max = cropToMaxValue(max);
+		//		min = cropToMaxValue(min);
+		//		max = cropToMaxValue(max);
 		return new Integer[]{min, max};
 	}
-	
+
 	private Integer[] parseEmptySegments(ParseTree emptySegments) {
 		Integer min = 0;
 		Integer max = 0;
@@ -638,8 +652,8 @@
 				}
 			}
 		}
-//		min = cropToMaxValue(min);
-//		max = cropToMaxValue(max);
+		//		min = cropToMaxValue(min);
+		//		max = cropToMaxValue(max);
 		return new Integer[]{min, max};
 	}
 
diff --git a/src/test/java/AqlTreeTest.java b/src/test/java/AqlTreeTest.java
index b3ad0fc..d10b07c 100644
--- a/src/test/java/AqlTreeTest.java
+++ b/src/test/java/AqlTreeTest.java
@@ -20,7 +20,7 @@
 	
 	@Test
 	public void testContext() throws QueryException {
-		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld";
+		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld";
 		aqlt = new AqlTree("Test");
 		assertEquals(contextString.replaceAll(" ", ""), aqlt.getRequestMap().get("@context").toString().replaceAll(" ", ""));
 	}
@@ -194,7 +194,7 @@
 						"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 							"{@type=korap:group, operation=operation:relation, operands=[" +
 								"{@type=korap:span, layer=cat, key=CP, match=match:eq}," +
-								"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 									"{@type=korap:span, layer=cat, key=VP, match=match:eq}" +
 								"]}" +
 							"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
@@ -214,12 +214,12 @@
 								"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 									"{@type=korap:group, operation=operation:relation, operands=[" +
 										"{@type=korap:span, layer=cat, key=CP, match=match:eq}," +
-										"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+										"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 											"{@type=korap:span, layer=cat, key=VP, match=match:eq}" +
 										"]}" +
 									"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
 								"]}," +
-								"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 									"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
 								"]}" +
 							"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
@@ -308,7 +308,7 @@
 						"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 							"{@type=korap:group, operation=operation:sequence, operands=[" +
 								"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Sonne, match=match:eq}}," +
-								"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mond, match=match:eq}}" +
 								"]}" +
 							"], distances=[" +
@@ -330,7 +330,7 @@
 						"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 							"{@type=korap:group, operation=operation:sequence, operands=[" +
 								"{@type=korap:span}," +
-								"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 									"{@type=korap:span}" +
 								"]} "+
 							"], inOrder=true}" +
@@ -352,14 +352,14 @@
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Sonne, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mond, match=match:eq}}" +
 									"]}" +
 								"], distances=[" +
 									"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=0, max=2}, min=0, max=2}" +
 								"], inOrder=true}" +
 							"]}," +	
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 								"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Sterne, match=match:eq}}" +
 							"]}" +
 						"],distances=[" +
@@ -381,7 +381,7 @@
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 									"{@type=korap:group, operation=operation:relation, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Sonne, match=match:eq}}," +
-										"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+										"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 											"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mond, match=match:eq}}" +
 										"]}" +
 									"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
@@ -401,7 +401,7 @@
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 									"{@type=korap:group, operation=operation:relation, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Sonne, match=match:eq}}," +
-										"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+										"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 											"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mond, match=match:eq}}" +
 										"]}" +
 									"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
@@ -422,13 +422,13 @@
 						"{@type=korap:group, operation=operation:relation, operands=[" +
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 								"{@type=korap:group, operation=operation:relation, operands=[" +
-									"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 										"{@type=korap:span}" +
 									"]}," +
 									"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
 								"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
 							"]}," +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 								"{@type=korap:span, layer=cat, key=VP, match=match:eq}" +
 							"]}" +
 						"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}" +
@@ -449,10 +449,10 @@
 		String eq2 =
 				"{@type=korap:group, operation=operation:position, frames=[frame:startswith], sharedClasses=[sharedClasses:includes], operands=[" +
 						"{@type=korap:group, operation=operation:relation, operands=[" +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=, classOut=1025, operands=[" +
 								"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
 							"]}," +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=, classOut=1025, operands=[" +
 								"{@type=korap:span, layer=cat, key=VP, match=match:eq}" +
 							"]}" +
 						"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}," +
@@ -530,7 +530,7 @@
 			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=V, match=match:eq}}" +
 					"]}" +
 				"], inOrder=true}" +
@@ -548,7 +548,7 @@
 			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=V, match=match:eq}}" +
 					"]}" +
 				"], inOrder=true}" +
@@ -564,7 +564,7 @@
 			"{@type=korap:group, operation=operation:relation, operands=[" +
 				"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 					"{@type=korap:group, operation=operation:relation, operands=[" +
-						"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+						"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
 						"]}," +
 						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=V, match=match:eq}}" +
@@ -585,16 +585,16 @@
 							// dominance relation #1 > #2 is reduced to #1, for expressing #1 > #3
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 								"{@type=korap:group, operation=operation:relation, operands=[" +
-									"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 										"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
 									"]}," +
-									"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=V, match=match:eq}}" +
 									"]}" +
 								"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
 							"]}," +
 							// establish class 2 around P for later reference
-							"{@type=korap:group, operation=operation:class, class=2, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1026, classOut=1026, operands=[" +
 								"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=P, match=match:eq}}" +
 							"]}" +
 						"], relation={@type=korap:relation, wrap={@type=korap:term, layer=c}}}" +
@@ -649,7 +649,7 @@
 				"{@type=korap:group, operation=operation:relation, operands=[" +
 						"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 							"{@type=korap:group, operation=operation:relation, operands=[" +
-								"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 									"{@type=korap:span}" +
 								"]}," +
 								"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
@@ -669,7 +669,7 @@
 						"{@type=korap:group, operation=operation:relation, operands=[" +
 							"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 								"{@type=korap:group, operation=operation:relation, operands=[" +
-									"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 										"{@type=korap:span}" +
 									"]}," +
 									"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
@@ -695,7 +695,7 @@
 								"{@type=korap:group, operation=operation:relation, operands=[" +
 									"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 										"{@type=korap:group, operation=operation:relation, operands=[" +
-											"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+											"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 												"{@type=korap:span}" +
 											"]}," +
 											"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
@@ -720,7 +720,7 @@
 				"{@type=korap:group, operation=operation:relation, operands=[" +
 						"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 							"{@type=korap:group, operation=operation:relation, operands=[" +
-								"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+								"{@type=korap:group, operation=operation:class, class=1024, classOut=1024, operands=[" +
 									"{@type=korap:span}" +
 								"]}," +
 								"{@type=korap:span, layer=cat, key=NP, match=match:eq}" +
diff --git a/src/test/java/CosmasTreeTest.java b/src/test/java/CosmasTreeTest.java
index e074ee8..2f8fe07 100644
--- a/src/test/java/CosmasTreeTest.java
+++ b/src/test/java/CosmasTreeTest.java
@@ -168,7 +168,7 @@
 		query="(Sonne oder Mond) und scheint";
 		String orand1 = 
 				"{@type=korap:group, operation=operation:sequence, distances=[" +
-					"{@type=korap:distance, key=t, min=0, max=0}" +
+					"{@type=cosmas:distance, key=t, min=0, max=0}" +
 					"], operands=[" +
 						"{@type=korap:group, operation=operation:or, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
@@ -183,7 +183,7 @@
 		query="scheint und (Sonne oder Mond)";
 		String orand2 = 
 				"{@type=korap:group, operation=operation:sequence, distances=[" +
-						"{@type=korap:distance, key=t, min=0, max=0}" +
+						"{@type=cosmas:distance, key=t, min=0, max=0}" +
 					"], operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}," +
 						"{@type=korap:group, operation=operation:or, operands=[" +
@@ -198,11 +198,11 @@
 		query="Regen und scheint und (Sonne oder Mond)";
 		String orand3 = 
 				"{@type=korap:group, operation=operation:sequence, distances=[" +
-						"{@type=korap:distance, key=t, min=0, max=0}" +
+						"{@type=cosmas:distance, key=t, min=0, max=0}" +
 				"], operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, key=Regen, layer=orth, match=match:eq}}," +
 					"{@type=korap:group, operation=operation:sequence, distances=[" +
-							"{@type=korap:distance, key=t, min=0, max=0}" +
+							"{@type=cosmas:distance, key=t, min=0, max=0}" +
 						"], operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}," +
 							"{@type=korap:group, operation=operation:or, operands=[" +
@@ -253,8 +253,8 @@
 						"], inOrder=true, " +
 						"distances=[" +
 							"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1, max=4}, min=1, max=4}," +
-							"{@type=korap:distance, key=s, boundary={@type=korap:boundary, min=0, max=0}, min=0, max=0}," +
-							"{@type=korap:distance, key=p, boundary={@type=korap:boundary, min=1, max=3}, min=1, max=3}" +
+							"{@type=cosmas:distance, key=s, boundary={@type=korap:boundary, min=0, max=0}, min=0, max=0}," +
+							"{@type=cosmas:distance, key=p, boundary={@type=korap:boundary, min=1, max=3}, min=1, max=3}" +
 						"]" +
 					"}" +
 				"]}";
@@ -276,8 +276,8 @@
 						"], inOrder=true, " +
 						"distances=[" +
 							"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1, max=4}, min=1, max=4, exclude=true}," +
-							"{@type=korap:distance, key=s, boundary={@type=korap:boundary, min=0, max=0}, min=0, max=0, exclude=true}," +
-							"{@type=korap:distance, key=p, boundary={@type=korap:boundary, min=1, max=3}, min=1, max=3, exclude=true}" +
+							"{@type=cosmas:distance, key=s, boundary={@type=korap:boundary, min=0, max=0}, min=0, max=0, exclude=true}," +
+							"{@type=cosmas:distance, key=p, boundary={@type=korap:boundary, min=1, max=3}, min=1, max=3, exclude=true}" +
 						"]" +
 					"}" +
 				"]}";
@@ -801,7 +801,7 @@
 		query="Sonne nicht Mond";
 		String opnot1 = 
 					"{@type=korap:group, operation=operation:sequence, distances=[" +
-						"{@type=korap:distance, key=t, min=0, max=0, exclude=true}" +
+						"{@type=cosmas:distance, key=t, min=0, max=0, exclude=true}" +
 					"], operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
 						"{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
@@ -1175,23 +1175,6 @@
 	@Test
 	public void testOPNHIT() throws QueryException {
 		query="#NHIT(gehen /w1:10 voran)";
-//		String nhit1 = 
-//				"{@type=korap:reference, operation=operation:focus, classRef=[1025], classRefOp=classRefOp:inversion, operands=[" +
-//					"{@type=korap:group, operation=operation:sequence, " +
-//						"operands=[" +
-//							"{@type=korap:group, operation=operation:class, class= , classOut=1025, operands=[" +
-//								"{@type=korap:token, wrap={@type=korap:term, key=gehen, layer=orth, match=match:eq}}" +
-//							"]}," +
-//							"{@type=korap:group, operation=operation:class, class= , classOut=1025, operands=[" +
-//								"{@type=korap:token, wrap={@type=korap:term, key=voran, layer=orth, match=match:eq}}" +
-//							"]}" +
-//						"], inOrder=false, " +
-//						"distances=[" +
-//							"{@type=korap:distance, key=w, boundary={@type=korap:boundary, min=1, max=10}, min=1, max=10}" +
-//						"]" +
-//					"}" +
-//				"]}";
-//		
 		String nhit1 = 
 				"{@type=korap:reference, operation=operation:focus, classRef=[1025], operands=[" +
 					"{@type=korap:group, operation=operation:class, classRefOp=classRefOp:inversion, classIn=[1026,1027], classOut=1025, operands=[" +
@@ -1213,7 +1196,7 @@
 		ct = new CosmasTree(query);
 		map = ct.getRequestMap().get("query").toString();
 		assertEquals(nhit1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-//		
+
 //		query="#NHIT(gehen %w1:10 voran)";
 //		String nhit2 = 
 //				"{@type=korap:reference, operation=operation:focus, classRef=1025, operands=[" +
diff --git a/src/test/java/PoliqarpPlusTreeTest.java b/src/test/java/PoliqarpPlusTreeTest.java
index 53145d8..3a79aaa 100644
--- a/src/test/java/PoliqarpPlusTreeTest.java
+++ b/src/test/java/PoliqarpPlusTreeTest.java
@@ -10,6 +10,8 @@
 	PoliqarpPlusTree ppt;
 	String map;
 	String expected;
+	String metaExpected;
+	String metaMap;
 	String query;
 	
 	private boolean equalsQueryContent(String res, String query) throws QueryException {
@@ -21,14 +23,13 @@
 	
 	@Test
 	public void testContext() throws QueryException {
-		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld";
+		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld";
 		ppt = new PoliqarpPlusTree("Test");
 		assertEquals(contextString.replaceAll(" ", ""), ppt.getRequestMap().get("@context").toString().replaceAll(" ", ""));
 	}
 	
 	@Test
 	public void testSingleTokens() throws QueryException {
-		String query;
 		// [base=Mann]
 		String token1 = "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}";
 		assertTrue(equalsQueryContent(token1, "[base=Mann]"));
@@ -60,8 +61,6 @@
 	
 	@Test
 	public void testValue() throws QueryException {
-		String query;
-		
 		query = "[mate/m=temp:pres]";
 		String value1 = "{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=m, key=temp, value=pres, match=match:eq}}";
 		ppt = new PoliqarpPlusTree(query);
@@ -71,7 +70,7 @@
 	
 	@Test
 	public void testRegex() throws QueryException {
-		String query = "[orth=\"M(a|ä)nn(er)?\"]";
+		query = "[orth=\"M(a|ä)nn(er)?\"]";
 		String re1 = "{@type=korap:token, wrap={@type=korap:term, layer=orth, type=type:regex, key=M(a|ä)nn(er)?, match=match:eq}}";
 		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
@@ -110,7 +109,7 @@
 	
 	@Test
 	public void testCaseSensitivityFlag() throws QueryException {
-		String query="[orth=deutscher/i]";
+		query="[orth=deutscher/i]";
 		String cs1 = 
 				"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=deutscher, match=match:eq, caseInsensitive=true}}";
 		ppt = new PoliqarpPlusTree(query);
@@ -386,7 +385,7 @@
 				"{@type=korap:group, operation=operation:sequence, " +
 				"operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 					  "{@type=korap:span, key=s}," +
 					  "{@type=korap:span, key=np}" +
 					"], frame=frame:contains}" +
@@ -405,7 +404,7 @@
 		expected = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						"{@type=korap:token}" +
 					"]}," +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
@@ -417,7 +416,7 @@
 		query = "{1:[]}[base=der][base=Mann]";
 		expected = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						"{@type=korap:token}" +
 					"]}," +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
@@ -432,7 +431,7 @@
 	public void testLeadingTrailingEmptyTokens() throws QueryException {
 		// startswith(<s>, [][base=Mann]
 		String et1 = 
-			"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +	
+			"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +	
 				"{@type=korap:span, key=s}," +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token}," +
@@ -498,7 +497,7 @@
 					"{@type=korap:group, operation=operation:repetition, operands=[" +
 						"{@type=korap:token}" +
 					"], boundary={@type=korap:boundary, min=1}, min=1}," +
-					"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 					  "{@type=korap:span, key=s}," +
 					  "{@type=korap:span, key=np}" +
 					"], frame=frame:contains}," +
@@ -874,7 +873,7 @@
 	public void testClasses() throws QueryException {
 		String query;
 		// {[base=Mann]}
-		String cls1 = "{@type=korap:group, operation=operation:class, class=0, operands=[" +
+		String cls1 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
 				"]}";
 		ppt = new PoliqarpPlusTree("{[base=Mann]}");
@@ -883,7 +882,7 @@
 		
 		// {[base=Mann][orth=Frau]}
 		query = "{[base=Mann][orth=Frau]}";
-		String cls2 = "{@type=korap:group, operation=operation:class, class=0, operands=[" +
+		String cls2 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 				 "{@type=korap:group, operation=operation:sequence, operands=[" +
 				  "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
 				  "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -896,7 +895,7 @@
 		// [p=NN]{[base=Mann][orth=Frau]}
 		String cls3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}," +
-						"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+						"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 							"{@type=korap:group, operation=operation:sequence, operands=[" +
 								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
 								"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -909,7 +908,7 @@
 		
 		// {[base=Mann][orth=Frau]}[p=NN]
 		String cls4 = "{@type=korap:group, operation=operation:sequence, operands=[" +
-						"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+						"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 						   "{@type=korap:group, operation=operation:sequence, operands=[" +
 						     "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
 						     "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -922,9 +921,9 @@
 		assertEquals(cls4.replaceAll(" ", ""), map.replaceAll(" ", ""));
 
 		// {2:{1:[tt/p=ADJA]}[mate/p=NN]}"
-		String cls5 = "{@type=korap:group, operation=operation:class, class=2, operands=[" +
+		String cls5 = "{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
-						   "{@type=korap:group, operation=operation:class, class=1, operands=[" +
+						   "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						     "{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=ADJA, match=match:eq}}" +
 						   "]}," +
 						   "{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=NN, match=match:eq}}" + 
@@ -938,21 +937,21 @@
 	@Test
 	public void testPositions() throws QueryException {
 		// contains(<s>,<np>)
-		String pos1 = "{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+		String pos1 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  "{@type=korap:span, key=s}," +
 				  "{@type=korap:span, key=np}" +
 				"], frame=frame:contains}";
 		assertTrue(equalsQueryContent(pos1, "contains(<s>,<np>)"));
 		
 		// contains(<s>,[base=Mann])
-		String pos2 = "{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+		String pos2 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  "{@type=korap:span, key=s}," +
 				  "{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
 				"], frame=frame:contains}";
 		assertTrue(equalsQueryContent(pos2, "contains(<s>,[base=Mann])"));
 		
 		// contains(<s>,[orth=der][orth=Mann])
-		String pos3 = "{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+		String pos3 = "{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  	"{@type=korap:span, key=s}," +
 				  	"{@type=korap:group, operation=operation:sequence, operands=[" +
 				  		"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
@@ -967,7 +966,7 @@
 		String pos4 = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  		"{@type=korap:span, key=s}," +
 				  		"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
 				  	"], frame=frame:contains}" +
@@ -978,7 +977,7 @@
 		
 		// contains(<s>,[pos=N]*)
 		String pos5 = 
-					"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  		"{@type=korap:span, key=s}," +
 				  		"{@type=korap:group, operation=operation:repetition, " +
 				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
@@ -993,7 +992,7 @@
 		String pos6 = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Auto, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+					"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				  		"{@type=korap:span, key=s}," +
 				  		"{@type=korap:group, operation=operation:repetition, " +
 				  			"operands=[{@type=korap:token, wrap={@type=korap:term, layer=pos, key=N, match=match:eq}}" +
@@ -1010,9 +1009,9 @@
 	public void testNestedPositions() throws QueryException {
 		// contains(<s>,startswith(<np>,[orth=Der]))
 		String npos1 = 
-			"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+			"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 				"{@type=korap:span, key=s}," +
-				"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
 					"{@type=korap:span, key=np}," +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}" +
 				"], frame=frame:startswith}" +
@@ -1029,7 +1028,7 @@
 			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
 					"]}" +
 				"]}" +
@@ -1043,7 +1042,7 @@
 			"{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
@@ -1060,7 +1059,7 @@
 			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
@@ -1075,9 +1074,9 @@
 		// focus(1:startswith(<s>,{1:<np>}))
 		String shr4 = 
 			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
 					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						"{@type=korap:span, key=np}" +
 					"]}" +
 				"], frame=frame:startswith}" +
@@ -1089,15 +1088,15 @@
 		// focus(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
 		String shr5 = 
 			"{@type=korap:reference, operation=operation:focus, classRef=[3], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
 					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
 									"]}" + 
 								"]}" +
@@ -1113,15 +1112,15 @@
 		// split(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
 		String shr6 = 
 			"{@type=korap:reference, operation=operation:split, classRef=[3], operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
 					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
 									"]}" + 
 								"]}" +
@@ -1137,15 +1136,15 @@
 		// split(2|3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}})) 
 		String shr7 = 
 			"{@type=korap:reference, operation=operation:split, classRef=[2, 3], classRefOp=classRefOp:intersection, operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[frame:startswith],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:startswith], operands=[" +
 					"{@type=korap:span, key=s}," +
-					"{@type=korap:group, operation=operation:class, class=3, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=3, classOut=3, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, foundry=mate, layer=p, key=ADJA, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:class, class=2, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=2, classOut=2, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, foundry=tt, layer=p, key=NN, match=match:eq}}" +
 									"]}" + 
 								"]}" +
@@ -1162,10 +1161,10 @@
 		String shr8 = 
 			"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
-					"{@type=korap:group, operation=operation:class, class=0, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}" +
 					"]}," +
-					"{@type=korap:group, operation=operation:class, class=1, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=pos, key=ADJA, match=match:eq}}" +
 					"]}" +
 				"]}" +
@@ -1201,7 +1200,7 @@
 		query = "submatch(1,4:contains(<s>,[base=Haus]))";
 		expected = 
 			"{@type=korap:reference, operation=operation:focus, operands=[" +
-				"{@type=korap:group, operation=operation:position, frames=[],sharedClasses=[sharedClasses:includes], operands=[" +
+				"{@type=korap:group, operation=operation:position, frames=[frames:contains], operands=[" +
 					"{@type=korap:span, key=s}," +
 					"{@type=korap:token, wrap= {@type=korap:term, layer=lemma, key=Haus, match=match:eq}}" +
 				"], frame=frame:contains}" +
@@ -1308,85 +1307,106 @@
 	@Test
 	public void testAlign() throws QueryException {
 		// [orth=der]^[orth=Mann]
-		String align1 = 
+		query = "[orth=der]^[orth=Mann]";
+		expected = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:alignment, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
-					"], align=align:left}" +
+					"]}" +
 				"]}";
-		ppt = new PoliqarpPlusTree("[orth=der]^[orth=Mann]");
+		metaExpected = 
+				"{alignment=1025}";
+		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(align1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		metaMap = ppt.getRequestMap().get("meta").toString();
+		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
 		
 		// [orth=der]^[orth=große][orth=Mann]
-		String query = "[orth=der]^[orth=große][orth=Mann]";
-		String align1b = 
+		query = "[orth=der]^[orth=große][orth=Mann]";
+		String expected = 
 				"{@type=korap:group, operation=operation:sequence, operands=[" +
 					"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=der, match=match:eq}}," +
-					"{@type=korap:group, operation=operation:alignment, operands=[" +
+					"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=große, match=match:eq}}," +
 							"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
 						"]}" +
-					"], align=align:left}" +
+					"]}" +
 				"]}";
+		metaExpected = 
+				"{alignment=1025}";
 		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(align1b.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		metaMap = ppt.getRequestMap().get("meta").toString();
+		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
 		
-		// "([base=a]^[base=b])|[base=c]",
-		String align2 = 
+		query = "([base=a]^[base=b])|[base=c]";
+		expected = 
 				"{@type=korap:group, operation=operation:or, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:alignment, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 								"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}" +
-							"], align=align:left}" +
+							"]}" +
 						"]}," +
 						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
 				"]}";
-		ppt = new PoliqarpPlusTree("([base=a]^[base=b])|[base=c]");
+		metaExpected = 
+				"{alignment=1025}";
+		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(align2.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		metaMap = ppt.getRequestMap().get("meta").toString();
+		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
 		
-		// "([base=a]^[base=b][base=c])|[base=d]",
-		String align3 = 
+		query = "([base=a]^[base=b][base=c])|[base=d]";
+		expected = 
 				"{@type=korap:group, operation=operation:or, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:alignment, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
 									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
 								"]}" +
-							"], align=align:left}" +
+							"]}" +
 						"]}," +
 						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
 				"]}";
-		ppt = new PoliqarpPlusTree("([base=a]^[base=b][base=c])|[base=d]");
+		metaExpected = 
+				"{alignment=1025}";
+		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(align3.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		metaMap = ppt.getRequestMap().get("meta").toString();
+		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
 		
-		// "([base=a]^[base=b]^[base=c])|[base=d]",
-		String align4 = 
+		query = "([base=a]^[base=b]^[base=c])|[base=d]";
+		expected = 
 				"{@type=korap:group, operation=operation:or, operands=[" +
 						"{@type=korap:group, operation=operation:sequence, operands=[" +
 							"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=a, match=match:eq}}," +
-							"{@type=korap:group, operation=operation:alignment, operands=[" +
+							"{@type=korap:group, operation=operation:class, class=1025, classOut=1025, operands=[" +
 								"{@type=korap:group, operation=operation:sequence, operands=[" +
 									"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=b, match=match:eq}}," +
-									"{@type=korap:group, operation=operation:alignment, operands=[" +
+									"{@type=korap:group, operation=operation:class, class=1026, classOut=1026, operands=[" +
 										"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=c, match=match:eq}}" +
-									"], align=align:left}" +
+									"]}" +
 								"]}" +
-							"], align=align:left}" +
+							"]}" +
 						"]}," +
 						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=d, match=match:eq}}" +
 				"]}";
-		ppt = new PoliqarpPlusTree("([base=a]^[base=b]^[base=c])|[base=d]");
+		metaExpected = 
+				"{alignment=[1025,1026]}";
+		ppt = new PoliqarpPlusTree(query);
 		map = ppt.getRequestMap().get("query").toString();
-		assertEquals(align4.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		metaMap = ppt.getRequestMap().get("meta").toString();
+		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		assertEquals(metaExpected.replaceAll(" ", ""), metaMap.replaceAll(" ", ""));
 		
 		
 	}
