this is a slightly faster method than copying to a new array, it's valid because we're using `foreach` which will keep on iterating the array that was passed in, regardless of modification. This wouldn't work with `for` for example.