add isPalindrome
compress function added