Made some changes to the permutation testing.