add a function to perform a permutation-based test