add test swapping for array