Moved usedids[] to the heap