slightly uglier, but necessarily to handle even length palindromes