Fragment permutation code