Remove a portion of the array and replace it with something else