implement permutations of string