Begin permutation functionality