Added GenerateAllPermutations