refactor is_palindrome to remove conditional
implement palindrome for enumerable