added permuteNArrays