no longer destroys original array