How do I remove an element from an array without changing the index values for the rest of the array?