chapter 5 exercise 5-10: palindrome