script to perform permutation test