rem: bag->items[bag->count++] = item;
add: if (index >= 0 && index < bag->count) { memmove(&bag->items[index+1], &bag->items[index], (bag->count - index) * sizeof(void*)); } else {  index = bag->count; } bag->items[index] = item; bag->count++;
context: WMInsertInBag(WMBag *bag, int index, void *item){    if (bag->count == bag->size) {	bag->size += 16;	bag->items = wrealloc(bag->items, sizeof(void*) * bag->size);    }    bag->items[bag->count++] = item;}