updated linked list to reuse the slots for deleted items