generating all permutations of characters in a string.