public E remove(int index) throws IndexOutOfBoundsException {
        if (index < 0 || index > length) {
            throw new IndexOutOfBoundsException();
        }
        if (length == 1) {
            return removeOnly();
        }
        if (index == 0) {
            return removeFirst();
        }
        if (index == length-1) {
            return removeLast();
        }
        seekTo(index);
        current.toFront.toBack = current.toBack;
        current.toBack.toFront = current.toFront;
        E temp = current.value;
        current = current.toFront;
        current_index--;
        length--;
        return temp;
    }