Replace the slice method with delete