public String toString() {
        String arrayString = "";
        Occurrence temp = head;
        while (head != null) {
            arrayString = head.getDocName() + " " + head.getTermFrequency() + "; " + arrayString;
            head = head.next;
        }
        head = temp;
        return arrayString;
    }