Added index tracking to splice item off array