Created a function to get all permutations of a string