public void addToEnd(int value) {
        ListElement current = new ListElement(value);
        if (count == 0) {
            head = current;
        } else {
            tail.next = current;
        }
        tail = current;
        count++;
    }