array sorts are in-place, we should copy instead