public String remove(int key) {
        Node current, previous;
        current = head;
        previous = null;
        while (current != null && current.getKey() != key) {
            previous = current;
            current = current.getNext();
        }
        String output = current.getContent();
        if (previous == null) {
            head = head.getNext();
            size--;
            return output;
        }
        previous.setNext(current.getNext());
        size--;
        return output;
    }