public void Remove(ref LinearList <double> posl, int index) { for (int i = index; i < count; i++) { posl[i].number = posl[i].number - 1; } LinearList <double> copy = new LinearList <double>(count); copy = (LinearList <double>)posl.MemberwiseClone(); posl = new LinearList <double>(count - 1); int COUNT = 0; for (int i = 0; i < count; i++) { if (i != index - 1) { posl[COUNT] = copy[i]; COUNT++; } } count--; }