adding FindAllPermutations code,still need to verify and complete