Update README with Code Review examples and reorganized configuration instructions
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。