public T remove(int index) {if (index == size - 1) {T[] blockRef = directory[toDirectoryIndex(index)];int blockIdx = toBlockIndex(index);T old = blockRef[blockIdx];blockRef[blockIdx] = null;size--;if (0 < tailBlkIdx)tailBlkIdx--;elseresetTailBlock();return old;} else if (index < 0 || size <= index) {throw new IndexOutOfBoundsException(String.valueOf(index));} else {T old = get(index);for (; index < size - 1; index++)set(index, get(index + 1));set(size - 1, null);size--;resetTailBlock();return old;}}

public override T Remove(int index){if (index == size - 1){T[] blockRef = directory[ToDirectoryIndex(index)];int blockIdx = ToBlockIndex(index);T old = blockRef[blockIdx];blockRef[blockIdx] = default(T);size--;if (0 < tailBlkIdx){tailBlkIdx--;}else{ResetTailBlock();}return old;}else{if (index < 0 || size <= index){throw new IndexOutOfRangeException(index.ToString());}else{T old = this[index];for (; index < size - 1; index++){Set(index, this[index + 1]);}Set(size - 1, default(T));size--;ResetTailBlock();return old;}}}
