Added is_palindrome method and test cases