string permutator explained