public void addToMatrix(String elem, int docId) {
        if(!matrix.containsKey(elem)) {
            BitSet docs = new BitSet(docNumber);
            for(int i = 0; i<docNumber; i++) {
                docs.set(i, false);
            }
            docs.set(docId, true);
            matrix.put(elem, docs);
        } else {
           matrix.get(elem).set(docId, true);
        }
    }