added the ability to set a permutation