added permutation test functions