modified palindrome class to accepts sentences