diff --git a/README.md b/README.md
index 2e24791..aa60949 100644
--- a/README.md
+++ b/README.md
@@ -23,10 +23,19 @@
    the
    appropriate JAR file that corresponds to the desired version.
 
-2. **Install:** Upload the compiled jar file to the $gerrit_site/plugins directory, then refer to [configuration
-   parameters](#configuration-parameters) for settings, and restart Gerrit.
+2. **Install:** Upload the compiled jar file to the `$gerrit_site/plugins` directory.
 
-3. **Verify:** After installing the plugin, you can see the following information in Gerrit's logs:
+3. **Configure:** Set up the basic parameters in your `$gerrit_site/etc/gerrit.config`:
+- `gptToken`: OpenAI GPT token.
+- `gerritAuthBaseUrl`: The URL of your Gerrit instance. Similar to: https://gerrit.local.team/a
+- `gerritUserName`: Gerrit username.
+- `gerritPassword`: Gerrit password.
+- `globalEnable`: Default value is false. The plugin will only review specified repositories. If set to true, the plugin
+  will by default review all pull requests.
+
+  For enhanced security, consider storing sensitive information like gptToken and gerritPassword in a secure location or file. Detailed instructions on how to do this will be provided later in this document.
+
+4. **Verify:** After restarting Gerrit, you can see the following information in Gerrit's logs:
 
    ```bash
    INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin chatgpt-code-review-gerrit-plugin, version 1.0.0
@@ -34,6 +43,94 @@
 
    You can also check the status of the chatgpt-code-review-gerrit-plugin on Gerrit's plugin page as Enabled.
 
+## Code Review Example
+
+Consider the following code snippet:
+
+```java
+public static int stringToInt(String bar) throws Exception {
+    if (bar == null || bar.length() == 0) {
+        throw new Exception("Invalid string input");
+    }
+
+    int x = 0;
+    boolean y = false;
+    int z = 0;
+
+    if (bar.charAt(bar.length() - 1) == '-') {
+        y = true;
+    }
+
+    for (int i = z; i < bar.length(); i++) {
+        char w = bar.charAt(i);
+
+        if (w == ' ') {
+            continue;
+        }
+
+        x = x * 10 + (w - '0');
+    }
+
+    return -x;
+}
+```
+
+Upon review, here are some suggestions and potential issues for the given patch:
+
+- **Inconsistent handling of negative numbers:** According to the code, the function only reverts the sign of the output if the last char of the string is a "-". This is not a conventional way to define negative numbers in strings. Normally, the "-" sign should be at the start of the string.
+- **Error handling of non-number characters:** The function lacks handling of non-numeric characters comprehensively. It takes anything that isn't a space and calculates its ASCII value, which could yield undesired results if any unwanted character apart from numbers and spaces are introduced.
+- **Naming variables:** It could be good practice to use more descriptive variable names instead of x, y, z, and w.
+- **Handling of trailing spaces:** The function is currently continuing to the next iteration whenever it encounters a space. This would mean it won't handle trailing spaces well, because it won't realize it's reached the end of the valid part of the string.
+- **Unused Variable:** Variable 'y' is defined but never used.
+- **Always returns negative value:** This could be a logical error. Based on typical use cases, the conversion of a string to an integer would not always yield a negative result.
+
+Overall, it's recommended that the exception handling for the string to int conversion could be improved and the code for negative numbers should be fixed.
+
+### Optimize the code
+
+```
+@gpt Please review and optimize this code. I'd like to continue manually parsing the string
+```
+
+The existing code converts a string representing a number into its integer form. Nevertheless, it does not take into account certain circumstances such as input strings that contain characters aside from numbers, whitespaces, or a '-' at the last place. A '-' at the last place is not standard for indicating negative numbers; it should be at the first place. Furthermore, in its current state, the code always returns a negative number. Here is a revision of the code that optimizes logic and improves error handling.
+
+
+```java
+public static int stringToInt(String inputString) throws IllegalArgumentException {
+    if (inputString == null || inputString.trim().isEmpty()) {
+        throw new IllegalArgumentException("Invalid string input");
+    }
+
+    inputString = inputString.trim();
+    boolean isNegative = false;
+    String numStr = inputString;
+
+    if (inputString.charAt(0)=='-') {
+        isNegative = true;
+        numStr = inputString.substring(1);
+    }
+
+    int result = 0;
+
+    for (int i = 0; i < numStr.length(); i++) {
+        char c = numStr.charAt(i);
+
+        if (!Character.isDigit(c)) {
+            throw new IllegalArgumentException("Invalid string input: non-digit character encountered.");
+        }
+
+        result *= 10;
+        result += c - '0';
+    }
+
+    return isNegative ? -result : result;
+}
+
+```
+
+The above optimization validates that the string only contains valid characters. It throws an IllegalArgumentException in cases where the String is null, a string without characters, or a string containing non-digit characters. The exception in the event that it starts with '-' (unlike the original code, where it only checks if it ends with '-'), the 'inputString' is trimmed prior to processing to eliminate leading and trailing whitespaces.
+
+
 ## Configuration Parameters
 
 You have the option to establish global settings, or independently configure specific projects. If you choose
@@ -93,15 +190,6 @@
 Please ensure **strict control over the access permissions of `refs/meta/config`** since sensitive information such as
 `gptToken` and `gerritPassword` is configured in the `project.config` file within `refs/meta/config`.
 
-### Required Parameters
-
-- `gptToken`: OpenAI GPT token.
-- `gerritAuthBaseUrl`: The URL of your Gerrit instance. Similar to: https://gerrit.local.team/a
-- `gerritUserName`: Gerrit username.
-- `gerritPassword`: Gerrit password.
-- `globalEnable`: Default value is false. The plugin will only review specified repositories. If set to true, the plugin
-  will by default review all pull requests.
-
 ### Optional Parameters
 
 - `gptModel`: The default model is gpt-3.5-turbo. You can also configure it to gpt-3.5-turbo-16k, gpt-4 or gpt-4-32k.
diff --git a/README.zh.md b/README.zh.md
index 0dd2a78..98f612d 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -21,13 +21,108 @@
 2. **安装：** 将编译好的 jar 文件上传到 $gerrit_site/plugins 目录中，然后参考 [配置参数](#配置参数) 进行配置，再重启
    Gerrit。
 
-3. **确认：** 安装好插件后，你可以在 Gerrit 的日志中看到以下信息：
+3. **配置：** 在 `$gerrit_site/etc/gerrit.config` 文件中进行基本配置：
+- `gptToken`：OpenAI GPT token。
+- `gerritAuthBaseUrl`：Gerrit 实例的 URL。类似于：https://gerrit.local.team/a。
+- `gerritUserName`：Gerrit 用户名。
+- `gerritPassword`：Gerrit 密码。
+- `globalEnable`: 默认值为 false。插件将只会审查指定的仓库，如果设为 true，插件默认会审查所有 review 请求。
+
+  为了增强安全性，建议将敏感信息，如 gptToken 和 gerritPassword，存储在一个安全的位置或文件中。本文档后续部分将提供详细的操作指南。
+
+4. **确认：** 安装好插件后，你可以在 Gerrit 的日志中看到以下信息：
 
    ```bash
       INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin chatgpt-code-review-gerrit-plugin, version 1.0.0
     ```
    并可以在 Gerrit 的插件页面中看到 chatgpt-code-review-gerrit-plugin 插件的状态为 Enabled。
 
+## 代码审查示例
+
+提交以下代码进行审查:
+
+```java
+public static int stringToInt(String bar) throws Exception {
+    if (bar == null || bar.length() == 0) {
+        throw new Exception("Invalid string input");
+    }
+
+    int x = 0;
+    boolean y = false;
+    int z = 0;
+
+    if (bar.charAt(bar.length() - 1) == '-') {
+        y = true;
+    }
+
+    for (int i = z; i < bar.length(); i++) {
+        char w = bar.charAt(i);
+
+        if (w == ' ') {
+            continue;
+        }
+
+        x = x * 10 + (w - '0');
+    }
+
+    return -x;
+}
+```
+
+经过审查，以下是对所提供补丁的建议和可能存在的问题：
+
+**负数处理不当：**从代码中可以看出，只有当字符串的最后一个字符为"-"时，函数才会改变输出的正负号。但通常，"-"应该出现在字符串的开头来表示负数。
+**非数字字符处理不足：**该函数未能有效识别非数字字符。它会计算除空格外的任何字符的ASCII值，这意味着如果输入了不应存在的字符，可能会得到意外的输出。
+**变量命名不清晰：**建议使用更有描述性的变量名，而不是简单的x、y、z和w。
+**尾部空格处理不当：**当前函数在遇到空格时会直接进入下一个循环，这导致它无法正确处理字符串末尾的空格。
+**存在未使用的变量：**虽然定义了变量'y'，但代码中并未使用到。
+**总是返回负值：**这似乎是一个逻辑错误。通常，将字符串转换为整数并不总是得到负数。
+综上所述，建议加强字符串到整数的异常处理，并修正负数处理的逻辑。
+
+
+### 优化代码
+
+```
+@@gpt 请 review 并优化此代码。我希望继续手动解析这个字符串。
+```
+
+当前代码可以将代表数字的字符串转为整数，但存在一些遗漏。例如，它未能处理字符串中除数字、空格或末尾的'-'以外的字符。通常，'-'应该出现在字符串开头来表示负数，而不是末尾。此外，该代码始终返回负数。以下是代码的优化版本，其中改进了逻辑和错误处理。
+
+```java
+public static int stringToInt(String inputString) throws IllegalArgumentException {
+    if (inputString == null || inputString.trim().isEmpty()) {
+        throw new IllegalArgumentException("Invalid string input");
+    }
+
+    inputString = inputString.trim();
+    boolean isNegative = false;
+    String numStr = inputString;
+
+    if (inputString.charAt(0)=='-') {
+        isNegative = true;
+        numStr = inputString.substring(1);
+    }
+
+    int result = 0;
+
+    for (int i = 0; i < numStr.length(); i++) {
+        char c = numStr.charAt(i);
+
+        if (!Character.isDigit(c)) {
+            throw new IllegalArgumentException("Invalid string input: non-digit character encountered.");
+        }
+
+        result *= 10;
+        result += c - '0';
+    }
+
+    return isNegative ? -result : result;
+}
+
+```
+
+此次优化确保了字符串仅包含合法字符。当字符串为空、无任何字符或含有非数字字符时，会抛出 IllegalArgumentException 异常。不同于原始代码仅检查字符串是否以'-'结尾，现在如果字符串以'-'开头，处理前会先修剪'inputString'，去除其前后的空格。
+
 ## 配置参数
 
 你可以选择设定全局参数，或对特定项目进行独立配置。若进行独立配置，则相应的项目配置将覆盖全局参数。
@@ -84,14 +179,6 @@
 **请确保对 `refs/meta/config` 的访问权限被严格控制**，因为敏感信息（例如 `gptToken` 和 `gerritPassword`
 ）配置在 `project.config` 文件中。
 
-### 必填参数
-
-- `gptToken`：OpenAI GPT token。
-- `gerritAuthBaseUrl`：Gerrit 实例的 URL。类似于：https://gerrit.local.team/a
-- `gerritUserName`：Gerrit 用户名。
-- `gerritPassword`：Gerrit 密码。
-- `globalEnable`: 默认值为 false。插件将只会审查指定的仓库，如果设为 true，插件默认会审查所有 review 请求。
-
 ### 可选参数
 
 - `gptModel`：默认模型是 gpt-3.5-turbo。你也可以配置成 gpt-3.5-turbo-16k、gpt-4 或 gpt-4-32k。
