Query(byte[] chars){
        List<Literal> tempLiterals = new ArrayList<>();
        int start = 0;
        Literal possibleLiteral;
        for (int i = 0; i < chars.length; i++) {
            if(chars[i]==')'){
                possibleLiteral = new Literal(chars, start, i);
                if(head==null) {
                    head = possibleLiteral;
                }else {
                    if (!containsLiteral(tempLiterals, possibleLiteral))
                        tempLiterals.add(possibleLiteral);
                }
                start = i+2;
            }
        }
        //head = tempLiterals.remove(0);
        Collections.sort(tempLiterals);
       // literals = new Literal[tempLiterals.size()];
        literals = tempLiterals.toArray(new Literal[tempLiterals.size()]);
    }