Laboratory for the the permutation algorithm