array deletion function