replaced splice! with deleteat!