Improve flow for -i flag
diff --git a/README.md b/README.md
index 243692553d..2aaf45a290 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 
 GPT Engineer is made to be easy to adapt, extend, and make your agent learn how you want your code to look. It generates an entire codebase based on a prompt.
 
-- [Demo](https://twitter.com/antonosika/status/1667641038104674306) 
+- [Demo](https://twitter.com/antonosika/status/1667641038104674306)
 
 ## Project philosophy
 
diff --git a/gpt_engineer/ai.py b/gpt_engineer/ai.py
index 923fd655fc..db58d943f4 100644
--- a/gpt_engineer/ai.py
+++ b/gpt_engineer/ai.py
@@ -365,17 +365,16 @@ def create_chat_model(self, model: str, temperature) -> BaseChatModel:
         )
     # Fetch available models from OpenAI API
     supported = [model["id"] for model in openai.Model.list()["data"]]
-    if model in supported:
-        return ChatOpenAI(
-            model=model,
-            temperature=temperature,
-            streaming=True,
-            client=openai.ChatCompletion,
-        )
-    else:
+    if model not in supported:
         raise ValueError(
             f"Model {model} is not supported, supported models are: {supported}"
         )
+    return ChatOpenAI(
+        model=model,
+        temperature=temperature,
+        streaming=True,
+        client=openai.ChatCompletion,
+    )
 
 
 def get_tokenizer(model: str):
diff --git a/gpt_engineer/chat_to_files.py b/gpt_engineer/chat_to_files.py
index 394a7c18ad..4f8d3d963b 100644
--- a/gpt_engineer/chat_to_files.py
+++ b/gpt_engineer/chat_to_files.py
@@ -86,13 +86,10 @@ def overwrite_files(chat, dbs):
 
     files = parse_chat(chat)
     for file_name, file_content in files:
-        if file_name.find("../") > -1:
-            raise Exception(f"File name {file_name} attempted to access parent path.")
-        elif file_name == "README.md":
-            dbs.workspace["ExistingCodeModificationsREADME.md"] = file_content
+        if file_name == "README.md":
+            dbs.workspace["LAST_MODIFICATION_README.md"] = file_content
         else:
-            full_path = os.path.join(dbs.input.path, file_name)
-            dbs.workspace[full_path] = file_content
+            dbs.workspace[file_name] = file_content
 
 
 def get_code_strings(input) -> dict[str, str]:
@@ -115,6 +112,7 @@ def get_code_strings(input) -> dict[str, str]:
         with open(full_file_path, "r") as file:
             file_data = file.read()
         if file_data:
+            # TODO: Should below be the full path?
             file_name = os.path.relpath(full_file_path, input.path)
             files_dict[file_name] = file_data
     return files_dict
diff --git a/gpt_engineer/db.py b/gpt_engineer/db.py
index fdca5e0dcc..eb2bd3e7af 100644
--- a/gpt_engineer/db.py
+++ b/gpt_engineer/db.py
@@ -85,7 +85,7 @@ def get(self, key, default=None):
         except KeyError:
             return default
 
-    def __setitem__(self, key, val):
+    def __setitem__(self, key: str | Path, val: str):
         """
         Set the content of a file in the database.
 
@@ -101,6 +101,9 @@ def __setitem__(self, key, val):
         TypeError
             If val is not string.
         """
+        if str(key).startswith("../"):
+            raise ValueError(f"File name {key} attempted to access parent path.")
+
         full_path = self.path / key
         full_path.parent.mkdir(parents=True, exist_ok=True)
 
@@ -108,7 +111,7 @@ def __setitem__(self, key, val):
             full_path.write_text(val, encoding="utf-8")
         else:
             # If val is not string, raise an error.
-            raise TypeError("val must be either a str or bytes")
+            raise TypeError("val must be str")
 
 
 # dataclass for all dbs:
diff --git a/gpt_engineer/file_selector.py b/gpt_engineer/file_selector.py
index c00541c9f6..8c44d43d1f 100644
--- a/gpt_engineer/file_selector.py
+++ b/gpt_engineer/file_selector.py
@@ -7,7 +7,8 @@
 from pathlib import Path
 from typing import List, Union
 
-IGNORE_FOLDERS = {"site-packages", "node_modules"}
+IGNORE_FOLDERS = {"site-packages", "node_modules", "venv"}
+FILE_LIST_NAME = "file_list.txt"
 
 
 class DisplayablePath(object):
@@ -235,10 +236,7 @@ def ask_for_files(db_input) -> None:
         dict[str, str]: Dictionary where key = file name and value = file path
     """
     use_last_string = ""
-    is_valid_selection = False
-    can_use_last = False
     if "file_list.txt" in db_input:
-        can_use_last = True
         use_last_string = (
             "3. Use previous file list (available at "
             + f"{os.path.join(db_input.path, 'file_list.txt')})\n"
@@ -246,12 +244,17 @@ def ask_for_files(db_input) -> None:
         selection_number = 3
     else:
         selection_number = 1
-    selection_str = f"""How do you want to select the files?
+    selection_str = "\n".join(
+        [
+            "How do you want to select the files?",
+            "",
+            "1. Use File explorer.",
+            "2. Use Command-Line.",
+            use_last_string if len(use_last_string) > 1 else "",
+            f"Select option and press Enter (default={selection_number}): ",
+        ]
+    )
 
-1. Use Command-Line.
-2. Use File explorer.
-{use_last_string if len(use_last_string) > 1 else ""}
-Select option and press Enter (default={selection_number}): """
     file_path_list = []
     selected_number_str = input(selection_str)
     if selected_number_str:
@@ -260,30 +263,23 @@ def ask_for_files(db_input) -> None:
         except ValueError:
             print("Invalid number. Select a number from the list above.\n")
             sys.exit(1)
+
     if selection_number == 1:
-        # Open terminal selection
-        file_path_list = terminal_file_selector()
-        is_valid_selection = True
-    elif selection_number == 2:
         # Open GUI selection
         file_path_list = gui_file_selector()
-        is_valid_selection = True
-    else:
-        if can_use_last and selection_number == 3:
-            # Use previous file list
-            is_valid_selection = True
-    if not is_valid_selection:
+    elif selection_number == 2:
+        # Open terminal selection
+        file_path_list = terminal_file_selector()
+    if (
+        selection_number <= 0
+        or selection_number > 3
+        or (selection_number == 3 and not use_last_string)
+    ):
         print("Invalid number. Select a number from the list above.\n")
         sys.exit(1)
 
-    file_list_string = ""
     if not selection_number == 3:
-        # New files
-        for file_path in file_path_list:
-            file_list_string += str(file_path) + "\n"
-
-        # Write in file_list so the user can edit and remember what was done
-        db_input["file_list.txt"] = file_list_string
+        db_input["file_list.txt"] = "\n".join(file_path_list)
 
 
 def gui_file_selector() -> List[str]:
diff --git a/gpt_engineer/main.py b/gpt_engineer/main.py
index f00a7a1b95..68ed8807d1 100644
--- a/gpt_engineer/main.py
+++ b/gpt_engineer/main.py
@@ -49,7 +49,6 @@ def main(
     logging.basicConfig(level=logging.DEBUG if verbose else logging.INFO)
 
     # For the improve option take current project as path and add .gpteng folder
-    # By now, ignoring the 'project_path' argument
     if improve_option:
         # The default option for the --improve is the IMPROVE_CODE, not DEFAULT
         if steps_config == StepsConfig.DEFAULT:
@@ -83,9 +82,15 @@ def main(
         StepsConfig.EXECUTE_ONLY,
         StepsConfig.USE_FEEDBACK,
         StepsConfig.EVALUATE,
+        StepsConfig.IMPROVE_CODE,
     ]:
         archive(dbs)
 
+        if not dbs.input.get("prompt"):
+            dbs.input["prompt"] = input(
+                "\nWhat application do you want gpt-engineer to generate?\n"
+            )
+
     steps = STEPS[steps_config]
     for step in steps:
         messages = step(ai, dbs)
diff --git a/gpt_engineer/steps.py b/gpt_engineer/steps.py
index 7577e5963a..4f669a2412 100644
--- a/gpt_engineer/steps.py
+++ b/gpt_engineer/steps.py
@@ -16,7 +16,7 @@
     to_files,
 )
 from gpt_engineer.db import DBs
-from gpt_engineer.file_selector import ask_for_files
+from gpt_engineer.file_selector import FILE_LIST_NAME, ask_for_files
 from gpt_engineer.learning import human_review_input
 
 Message = Union[AIMessage, HumanMessage, SystemMessage]
@@ -325,25 +325,28 @@ def get_improve_prompt(ai: AI, dbs: DBs):
     Asks the user what they would like to fix.
     """
 
-    dbs.input["prompt"] = input(
-        "\nWhat do you need to improve with the selected files?\n"
-    )
-
-    confirm_str = f"""
-    -----------------------------
-    The following files will be used in the improvement process:
-    {dbs.input["file_list.txt"]}
-
-    The inserted prompt is the following:
-    '{dbs.input['prompt']}'
-    -----------------------------
-
-    You can change these files in .gpteng folder ({dbs.input.path}) in your project
-    before proceeding.
-
-    Press enter to proceed with modifications.
+    if not dbs.input.get("prompt"):
+        dbs.input["prompt"] = input(
+            "\nWhat do you need to improve with the selected files?\n"
+        )
 
-    """
+    confirm_str = "\n".join(
+        [
+            "-----------------------------",
+            "The following files will be used in the improvement process:",
+            f"{FILE_LIST_NAME}:",
+            str(dbs.input["file_list.txt"]),
+            "",
+            "The inserted prompt is the following:",
+            f"'{dbs.input['prompt']}'",
+            "-----------------------------",
+            "",
+            "You can change these files in your project before proceeding.",
+            "",
+            "Press enter to proceed with modifications.",
+            "",
+        ]
+    )
     input(confirm_str)
     return []
 
