straightforward implementation of isPalindrome, with input normalization