private T remove(int index) {
        if (index < 0 || index > size)
            return null;

        Node cur = head;
        for (int j = 0; j < index && cur.next != null; j++) {
            cur = cur.next;
        }
        Node r = cur;
//        Node storeAddressOfPreviousPointer = cur.prev;    // save the address of the previous node from this current
//        Node storeAddressOfNextPointer = cur.next;        // save the address of the next node from this current
//        storeAddressOfNextPointer.prev = storeAddressOfPreviousPointer;
//        storeAddressOfPreviousPointer.next = storeAddressOfNextPointer;

        cur.next.prev = cur.prev;
        cur.prev.next = cur.next;

        size--;
        modCount++;

        return r.data;
    }