added isPalindromic function