I am trying to remove array element in the middle with index shifting. The issue is that when I remove the element, the index is deleted as well. For example: