generating permutations, checking for palindromes, test for palindromes