public void deleteElement(int value) {
        ListElement current = head.next;
        ListElement previous = head;
        if (previous.value == value) {
            head = head.next;
            count--;
        } else {
            while (current != tail.next) {
                if (current.value == value) {
                    ListElement help = current.next;
                    previous.next = help;
                    previous = help;
                    current = help.next;
                    count--;
                } else {
                    previous = current;
                    current = current.next;
                }
            }
        }
    }