diff --git a/release-notes/2.0.0.md b/release-notes/2.0.0.md
index 84d2dfaa29c44ffa4123b9954145a4896f85134f..2713d98ec2d8b03d326f81e25cbc79422f483b4e 100644
--- a/release-notes/2.0.0.md
+++ b/release-notes/2.0.0.md
@@ -1,4 +1,4 @@
-# Team 112's Notes Application (Release 2.0.0)
+# Team 112's Notes Application (Release 1.0.0)
 > _Date: February 17, 2023_
 
 ## 🚀 What's New
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/GUInote.kt b/utilities/src/main/kotlin/notes/multi/utilities/GUInote.kt
new file mode 100644
index 0000000000000000000000000000000000000000..41f3859a875e43b82a4e0f6c942a3fc0a2b7e4e1
--- /dev/null
+++ b/utilities/src/main/kotlin/notes/multi/utilities/GUInote.kt
@@ -0,0 +1,52 @@
+package notes.multi.utilities
+
+import javafx.stage.Stage
+
+class GUInote {
+    private val openednotes = mutableListOf<String>()
+    private val notescenes = mutableListOf<notescene>()
+    private var browseropened = false
+
+    fun isbrowseropened() : Boolean {
+        return browseropened
+    }
+
+    fun setbrowseropened(bo: Boolean) {
+        browseropened = bo
+    }
+
+    fun addnotes(noteid:String) {
+        openednotes.add(noteid)
+    }
+
+    fun removenote(noteid:String) {
+        openednotes.remove(noteid)
+    }
+
+    fun findopened(noteid: String): Boolean {
+        return openednotes.contains(noteid)
+    }
+
+    fun addstage(ns:notescene) {
+        notescenes.add(ns)
+    }
+
+    fun removestage(ns: notescene) {
+        notescenes.remove(ns)
+    }
+
+    fun focusstage(noteid:String) {
+        for (i in notescenes) {
+            if (i.file().id == noteid) {
+                i.retstage().requestFocus()
+                println(i.retstage().isFocused)
+                i.retstage().toFront()
+            }
+        }
+    }
+
+    fun update() {
+
+    }
+
+}
\ No newline at end of file
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/NoteTextWindow.kt b/utilities/src/main/kotlin/notes/multi/utilities/NoteTextWindow.kt
index 5a339460f465ee3e9b38e5b38158e4df653b2b18..04dcebe3a7bd0dda8b37c651cad810bc4175d90e 100644
--- a/utilities/src/main/kotlin/notes/multi/utilities/NoteTextWindow.kt
+++ b/utilities/src/main/kotlin/notes/multi/utilities/NoteTextWindow.kt
@@ -37,22 +37,6 @@ class TextWindow(): Application() {
      */
     private var paramsMap = mutableMapOf<String, String>()
 
-    /**
-     * Boolean value denoting whether console has been pressed
-     */
-    private var controlPressed = false
-
-    private var newname = true
-    private var curfile = Note()
-
-    private fun notesname() : MutableList<String> {
-        val retlist = mutableListOf<String>()
-        val temp = DatabaseOperations.getAllNotes()
-        for (i in temp) {
-            retlist.add(i.title?:"")
-        }
-        return retlist
-    }
 
     override fun init() {
         super.init()
@@ -61,336 +45,12 @@ class TextWindow(): Application() {
     }
 
     override fun start(stage: Stage) {
-
-        val textarea = HTMLEditor()
-        //textarea.setText(paramsMap["text"])
+        val noteslist = GUInote()
+        val newwindow = notescene(stage, noteslist,0 )
         if (paramsMap.isNotEmpty()) {
-            stage.setTitle(paramsMap["title"])
-            textarea.htmlText = paramsMap["text"]
-            newname = false
-        } else {
-            stage.setTitle("Untitled")
-        }
-
-        //textarea.setWrapText(true)
-
-
-        val scroll = ScrollPane()
-        val anchor = AnchorPane(textarea)
-
-        AnchorPane.setTopAnchor(textarea, 0.0)
-        AnchorPane.setBottomAnchor(textarea, 0.0)
-        AnchorPane.setLeftAnchor(textarea, 0.0)
-        AnchorPane.setRightAnchor(textarea, 0.0)
-
-        scroll.isFitToHeight = true
-        scroll.hmin = 300.0
-        scroll.isFitToWidth = true
-
-        /**
-         * Responsive Design and scroll properties
-         */
-        scroll.content = textarea
-
-
-        /**
-         * MenuBar Design and implementation
-         */
-
-        val menubar = MenuBar()
-        val filemenu = Menu("File")
-        val modechange = Menu("Mode")
-
-        // File menu items
-        val open = MenuItem("Open")
-        val save = MenuItem("Save")
-        val rename = MenuItem("Rename")
-        val delete = MenuItem("Delete")
-
-        // Modechange menu items
-        val dark = MenuItem("Dark")
-        val light = MenuItem("Light")
-
-
-        open.setOnAction {
-            val browser = Stage()
-            browser.initModality(Modality.WINDOW_MODAL)
-            browser.initOwner(stage)
-            val noteslist = DatabaseOperations.getAllNotes()
-            val obsfs = FXCollections.observableArrayList<Note>()
-            obsfs.addAll(noteslist)
-            val titlecolumn = TableColumn<Note, String>("title")
-            titlecolumn.setCellValueFactory { it-> it.value.titleGUI}
-            val datecolumn = TableColumn<Note, String>("date modified")
-            datecolumn.setCellValueFactory { it->it.value.lastModifiedGUI }
-            val notesview = TableView<Note>()
-            notesview.items = obsfs
-            notesview.columns.addAll(titlecolumn, datecolumn)
-            notesview.columnResizePolicy = TableView.CONSTRAINED_RESIZE_POLICY
-
-
-            notesview.setOnMouseClicked { event->
-                val index = notesview.selectionModel.selectedIndex
-                if (index != -1) {
-                    if (event.clickCount == 2) {
-                        val tempnote = DatabaseOperations.getNote(obsfs[index].id)
-                        textarea.htmlText = tempnote.text.toString()
-                        stage.title = tempnote.title
-                        browser.close()
-                        curfile = tempnote
-                        newname = false
-                    }
-                }
-            }
-
-            val delete = Button("Delete")
-            val open = Button("Open")
-
-            open.setOnAction {
-                val index = notesview.selectionModel.selectedIndex
-                if (index != -1) {
-                        val tempnote = DatabaseOperations.getNote(obsfs[index].id)
-                        textarea.htmlText = tempnote.text.toString()
-                        stage.title = tempnote.title
-                        browser.close()
-                        curfile = tempnote
-                        newname = false
-                }
-            }
-
-            delete.setOnAction {
-                val index = notesview.selectionModel.selectedIndex
-                if (index != -1) {
-                    val tempnote = DatabaseOperations.getNote(obsfs[index].id)
-                    if (curfile.id == tempnote.id) {
-                        val warning = Alert(Alert.AlertType.ERROR)
-                        warning.title = "ERROR"
-                        warning.contentText = "This file is opened in program"
-                        warning.showAndWait()
-                    } else {
-                        val warningdel = Alert(Alert.AlertType.CONFIRMATION)
-                        warningdel.title = "DELETE"
-                        warningdel.contentText = "Do you delete this file?"
-                        val result = warningdel.showAndWait()
-                        if (result.isPresent) {
-                            when (result.get()) {
-                                ButtonType.OK -> {
-                                    DatabaseOperations.deleteNote(tempnote)
-                                    obsfs.removeAt(index)
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            val buttoncontainer = HBox(10.0, open, delete)
-
-            val generalcontainer = VBox(notesview, buttoncontainer)
-            VBox.setVgrow(notesview, Priority.ALWAYS)
-            browser.scene = Scene(generalcontainer)
-
-            browser.show()
-        }
-
-        save.setOnAction {
-            val warning = Alert(Alert.AlertType.CONFIRMATION)
-            warning.title = "SAVE"
-            warning.contentText = "Do you want to save this file?"
-            val result = warning.showAndWait()
-            if (result.isPresent) {
-                when (result.get()) {
-                    ButtonType.OK -> {
-                        if (newname) {
-                            while(true) {
-                                val renaming = TextInputDialog()
-                                renaming.headerText = "Enter new name"
-                                val result = renaming.showAndWait()
-                                if (result.isPresent) {
-                                    if (renaming.editor.text == "") {
-                                        val warning = Alert(Alert.AlertType.ERROR)
-                                        warning.title = "ERROR"
-                                        warning.contentText = "Empty can't be filename"
-                                        warning.showAndWait()
-                                    } else {
-                                        stage.title = renaming.editor.text
-                                        curfile.title = stage.title
-                                        newname = false
-                                        break
-                                    }
-                                } else {
-                                    break
-                                }
-                            }
-                        }
-
-                        if(!newname) {
-                            curfile.lastModified = LocalDateTime.now().toString()
-                            curfile.text = StringBuffer(textarea.htmlText)
-                            DatabaseOperations.addUpdateNote(curfile)
-                        }
-                    }
-                }
-            }
-        }
-
-        rename.setOnAction {
-            while(true) {
-                val renaming = TextInputDialog()
-                renaming.headerText = "Enter new name"
-                val result = renaming.showAndWait()
-                if (result.isPresent) {
-                    if (renaming.editor.text == "") {
-                        val warning = Alert(Alert.AlertType.ERROR)
-                        warning.title = "ERROR"
-                        warning.contentText = "Empty can't be filename"
-                        warning.showAndWait()
-                    } else {
-                        stage.title = renaming.editor.text
-                        curfile.title = stage.title
-                        curfile.lastModified = LocalDateTime.now().toString()
-                        newname = false
-                        break
-                    }
-                } else {
-                    break
-                }
-            }
-        }
-
-        delete.setOnAction {
-            val warning = Alert(Alert.AlertType.CONFIRMATION)
-            warning.title = "DELETE"
-            warning.contentText = "Do you delete this file?"
-            val result = warning.showAndWait()
-            if (result.isPresent) {
-                when (result.get()) {
-                    ButtonType.OK -> {
-                        DatabaseOperations.deleteNote(curfile)
-                        // filecontroller.deleteFile()
-
-//                        Database.connect("jdbc:sqlite:test.db")
-//                        transaction {
-//                            SchemaUtils.create(DatabaseOperations.Notes)
-//                            var deleteId = paramsMap["id"]?.toInt()
-//                            if (deleteId !== null && deleteId != -1) {
-//                                DatabaseOperations.deleteNote(deleteId)
-//                            }
-//                        }
-
-                        Platform.exit()
-                    }
-                }
-            }
+            newwindow.settitle(paramsMap["title"]!!)
+            newwindow.settext(paramsMap["text"]!!)
+            newwindow.setnewname(false)
         }
-
-        filemenu.items.addAll(open, save, rename, delete)
-        modechange.items.addAll(dark, light)
-        menubar.menus.addAll(filemenu, modechange)
-
-        val box = VBox(menubar, anchor)
-        VBox.setVgrow(anchor, Priority.ALWAYS)
-
-        stage.scene = Scene(box, 300.0, 300.0)
-
-        /**
-         * Logic for key presses:
-         * - Save: Ctrl + S
-         * - Delete: Ctrl + D
-         * - Close Window: Ctrl + W
-         */
-        stage.scene.setOnKeyPressed { event->
-            if (event.code == KeyCode.CONTROL) {
-                controlPressed = true
-            } else if (event.code == KeyCode.S && controlPressed) {
-                controlPressed = false
-                val warning = Alert(Alert.AlertType.CONFIRMATION)
-                warning.title = "SAVE"
-                warning.contentText = "Do you want to save this file?"
-                val result = warning.showAndWait()
-                if (result.isPresent) {
-                    when (result.get()) {
-                        ButtonType.OK -> {
-                            if (newname) {
-                                while(true) {
-                                    val renaming = TextInputDialog()
-                                    renaming.headerText = "Enter new name"
-                                    val result = renaming.showAndWait()
-                                    if (result.isPresent) {
-                                        if (renaming.editor.text == "") {
-                                            val warning = Alert(Alert.AlertType.ERROR)
-                                            warning.title = "ERROR"
-                                            warning.contentText = "Empty can't be filename"
-                                            warning.showAndWait()
-                                        } else {
-                                            stage.title = renaming.editor.text
-                                            curfile.title = stage.title
-                                            newname = false
-                                            break
-                                        }
-                                    } else {
-                                        break
-                                    }
-                                }
-                            }
-
-                            if(!newname) {
-                                curfile.lastModified = LocalDateTime.now().toString()
-                                curfile.text = StringBuffer(textarea.htmlText)
-                                DatabaseOperations.addUpdateNote(curfile)
-                            }
-                        }
-                    }
-                }
-            } else if (event.code == KeyCode.D && controlPressed) {
-                controlPressed = false
-                val warning = Alert(Alert.AlertType.CONFIRMATION)
-                warning.title = "DELETE"
-                warning.contentText = "Do you delete this file?"
-                val result = warning.showAndWait()
-                if (result.isPresent) {
-                    when (result.get()) {
-                        ButtonType.OK -> {
-                            DatabaseOperations.deleteNote(curfile)
-                            // filecontroller.deleteFile()
-
-//                            Database.connect("jdbc:sqlite:test.db")
-//                            transaction {
-//                                SchemaUtils.create(DatabaseOperations.Notes)
-//                                var deleteId = paramsMap["id"]?.toInt()
-//                                if (deleteId !== null && deleteId != -1) {
-//                                    DatabaseOperations.deleteNote(deleteId)
-//                                }
-//                            }
-
-                            Platform.exit()
-                        }
-                    }
-                }
-            } else if (event.code == KeyCode.W && controlPressed) {
-                controlPressed = false
-                val warning = Alert(Alert.AlertType.CONFIRMATION)
-                warning.title = "WARNING"
-                warning.contentText = "The current work will not be saved. Are you sure you want to quit?"
-                val result = warning.showAndWait()
-                if (result.isPresent) {
-                    when (result.get()) {
-                        ButtonType.OK -> {
-                            Platform.exit()
-                        }
-                    }
-                }
-            }
-        }
-
-        /**
-         * Control press logic
-         */
-        stage.scene.setOnKeyReleased {
-            if (controlPressed) {controlPressed = false}
-        }
-
-
-        stage.show()
     }
 }
\ No newline at end of file
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt b/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt
new file mode 100644
index 0000000000000000000000000000000000000000..87c03d1d0c80a7f601efef14d96797927b246b37
--- /dev/null
+++ b/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt
@@ -0,0 +1,432 @@
+package notes.multi.utilities
+
+import javafx.application.Platform
+import javafx.collections.FXCollections
+import javafx.scene.Scene
+import javafx.scene.control.*
+import javafx.scene.input.KeyCode
+import javafx.scene.layout.AnchorPane
+import javafx.scene.layout.HBox
+import javafx.scene.layout.Priority
+import javafx.scene.layout.VBox
+import javafx.scene.web.HTMLEditor
+import javafx.stage.Modality
+import javafx.stage.Stage
+import java.time.LocalDateTime
+
+class notescene(private val stage: Stage, private val lists:GUInote, private val id:Int) {
+    /**
+     * Boolean value denoting whether console has been pressed
+     */
+    private var controlPressed = false
+
+    private var newname = true
+    private var curfile = Note()
+    private var textarea = HTMLEditor()
+
+    fun file() :Note{
+        return curfile
+    }
+
+    fun retstage() : Stage {
+        return stage
+    }
+
+
+    init {
+        lists.addstage(this)
+
+        stage.setOnCloseRequest {
+            lists.removenote(curfile.id)
+            lists.removestage(this)
+        }
+        stage.title = "Untitled"
+        val scroll = ScrollPane()
+        val anchor = AnchorPane(textarea)
+
+        AnchorPane.setTopAnchor(textarea, 0.0)
+        AnchorPane.setBottomAnchor(textarea, 0.0)
+        AnchorPane.setLeftAnchor(textarea, 0.0)
+        AnchorPane.setRightAnchor(textarea, 0.0)
+
+        scroll.isFitToHeight = true
+        scroll.hmin = 300.0
+        scroll.isFitToWidth = true
+
+        /**
+         * Responsive Design and scroll properties
+         */
+        scroll.content = textarea
+
+
+        /**
+         * MenuBar Design and implementation
+         */
+
+        val menubar = MenuBar()
+        val filemenu = Menu("File")
+        val modechange = Menu("Mode")
+        val option = Menu("Option")
+
+        // File menu items
+        val new = MenuItem("New")
+        val open = MenuItem("Open")
+        val save = MenuItem("Save")
+        val rename = MenuItem("Rename")
+        val delete = MenuItem("Delete")
+
+        // Modechange menu items
+        val dark = MenuItem("Dark")
+        val light = MenuItem("Light")
+
+        // option menu items
+        val sync = MenuItem("Sync")
+
+        new.setOnAction {
+            val newwindow = Stage()
+            notescene(newwindow, lists, id+1)
+        }
+
+
+        open.setOnAction {
+            lists.setbrowseropened(true)
+            val browser = Stage()
+            browser.initModality(Modality.WINDOW_MODAL)
+            browser.initOwner(stage)
+            //lists.setowner(browser)
+            val noteslist = DatabaseOperations.getAllNotes()
+            val obsfs = FXCollections.observableArrayList<Note>()
+            obsfs.addAll(noteslist)
+            val titlecolumn = TableColumn<Note, String>("title")
+            titlecolumn.setCellValueFactory { it-> it.value.titleGUI}
+            val datecolumn = TableColumn<Note, String>("date modified")
+            datecolumn.setCellValueFactory { it->it.value.lastModifiedGUI }
+            val notesview = TableView<Note>()
+            notesview.items = obsfs
+            notesview.columns.addAll(titlecolumn, datecolumn)
+            notesview.columnResizePolicy = TableView.CONSTRAINED_RESIZE_POLICY
+
+
+            notesview.setOnMouseClicked { event->
+                val index = notesview.selectionModel.selectedIndex
+                if (index != -1) {
+                    if (event.clickCount == 2) {
+                        if (lists.findopened(obsfs[index].id)) {
+                            browser.close()
+                            lists.focusstage(obsfs[index].id)
+                        } else {
+                            val tempnote = DatabaseOperations.getNote(obsfs[index].id)
+                            textarea.htmlText = tempnote.text.toString()
+                            stage.title = tempnote.title
+                            browser.close()
+                            curfile = tempnote
+                            newname = false
+                            lists.addnotes(tempnote.id)
+                        }
+                        lists.setbrowseropened(false)
+                    }
+                }
+            }
+
+            val delete = Button("Delete")
+            val open = Button("Open")
+
+            open.setOnAction {
+                val index = notesview.selectionModel.selectedIndex
+                if (index != -1) {
+                    if (lists.findopened(obsfs[index].id)) {
+                        browser.close()
+                        lists.focusstage(obsfs[index].id)
+                    } else {
+                        val tempnote = DatabaseOperations.getNote(obsfs[index].id)
+                        textarea.htmlText = tempnote.text.toString()
+                        stage.title = tempnote.title
+                        browser.close()
+                        curfile = tempnote
+                        newname = false
+                        lists.addnotes(tempnote.id)
+                    }
+                    lists.setbrowseropened(false)
+                }
+            }
+
+            delete.setOnAction {
+                val index = notesview.selectionModel.selectedIndex
+                if (index != -1) {
+                    val tempnote = DatabaseOperations.getNote(obsfs[index].id)
+                    if (lists.findopened(obsfs[index].id)) {
+                        val warning = Alert(Alert.AlertType.ERROR)
+                        warning.title = "ERROR"
+                        warning.contentText = "This file is opened in program"
+                        warning.showAndWait()
+                    } else {
+                        val warningdel = Alert(Alert.AlertType.CONFIRMATION)
+                        warningdel.title = "DELETE"
+                        warningdel.contentText = "Do you delete this file?"
+                        val result = warningdel.showAndWait()
+                        if (result.isPresent) {
+                            when (result.get()) {
+                                ButtonType.OK -> {
+                                    DatabaseOperations.deleteNote(tempnote)
+                                    obsfs.removeAt(index)
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            val buttoncontainer = HBox(10.0, open, delete)
+
+            val generalcontainer = VBox(notesview, buttoncontainer)
+            VBox.setVgrow(notesview, Priority.ALWAYS)
+            browser.scene = Scene(generalcontainer)
+
+            browser.show()
+
+            browser.setOnCloseRequest {
+                lists.setbrowseropened(false)
+            }
+        }
+
+        save.setOnAction {
+            val warning = Alert(Alert.AlertType.CONFIRMATION)
+            warning.title = "SAVE"
+            warning.contentText = "Do you want to save this file?"
+            val result = warning.showAndWait()
+            if (result.isPresent) {
+                when (result.get()) {
+                    ButtonType.OK -> {
+                        if (newname) {
+                            while(true) {
+                                val renaming = TextInputDialog()
+                                renaming.headerText = "Enter new name"
+                                val result = renaming.showAndWait()
+                                if (result.isPresent) {
+                                    if (renaming.editor.text == "") {
+                                        val warning = Alert(Alert.AlertType.ERROR)
+                                        warning.title = "ERROR"
+                                        warning.contentText = "Empty can't be filename"
+                                        warning.showAndWait()
+                                    } else {
+                                        stage.title = renaming.editor.text
+                                        curfile.title = stage.title
+                                        newname = false
+                                        lists.addnotes(curfile.id)
+                                        break
+                                    }
+                                } else {
+                                    break
+                                }
+                            }
+                        }
+
+                        if(!newname) {
+                            curfile.lastModified = LocalDateTime.now().toString()
+                            curfile.text = StringBuffer(textarea.htmlText)
+                            DatabaseOperations.addUpdateNote(curfile)
+                        }
+                    }
+                }
+            }
+        }
+
+        rename.setOnAction {
+            while(true) {
+                val renaming = TextInputDialog()
+                renaming.headerText = "Enter new name"
+                val result = renaming.showAndWait()
+                if (result.isPresent) {
+                    if (renaming.editor.text == "") {
+                        val warning = Alert(Alert.AlertType.ERROR)
+                        warning.title = "ERROR"
+                        warning.contentText = "Empty can't be filename"
+                        warning.showAndWait()
+                    } else {
+                        stage.title = renaming.editor.text
+                        curfile.title = stage.title
+                        curfile.lastModified = LocalDateTime.now().toString()
+                        newname = false
+                        break
+                    }
+                } else {
+                    break
+                }
+            }
+        }
+
+        delete.setOnAction {
+            if (!lists.isbrowseropened()) {
+                val warning = Alert(Alert.AlertType.CONFIRMATION)
+                warning.title = "DELETE"
+                warning.contentText = "Do you delete this file?"
+                val result = warning.showAndWait()
+                if (result.isPresent) {
+                    when (result.get()) {
+                        ButtonType.OK -> {
+                            DatabaseOperations.deleteNote(curfile)
+                            stage.close()
+                        }
+                    }
+                }
+            } else {
+                val warning = Alert(Alert.AlertType.ERROR)
+                warning.title = "ERROR"
+                warning.contentText = "The file browser is opened elsewhere"
+                warning.showAndWait()
+            }
+        }
+
+        sync.setOnAction {
+            val warning = Alert(Alert.AlertType.CONFIRMATION)
+            warning.title = "SYNC"
+            warning.contentText = "After synchronization, your current work may be lost. Are you sure sync?"
+            val result = warning.showAndWait()
+            if (result.isPresent) {
+                when (result.get()) {
+                    ButtonType.OK -> {
+                        try {
+                            //TODO: WRITE SYNC DB LOGIC
+                            throw Exception()
+                        } catch(e:Exception) {
+                            val warning = Alert(Alert.AlertType.ERROR)
+                            warning.title = "ERROR"
+                            warning.contentText = "Sync failed due to no internet."
+                            warning.showAndWait()
+                        }
+                    }
+                }
+            }
+        }
+
+        filemenu.items.addAll(new, open, save, rename, delete)
+        modechange.items.addAll(dark, light)
+        option.items.addAll(sync)
+        menubar.menus.addAll(filemenu, modechange, option)
+
+        val box = VBox(menubar, anchor)
+        VBox.setVgrow(anchor, Priority.ALWAYS)
+
+        stage.scene = Scene(box, 300.0, 300.0)
+
+        /**
+         * Logic for key presses:
+         * - Save: Ctrl + S
+         * - Delete: Ctrl + D
+         * - Close Window: Ctrl + W
+         */
+        stage.scene.setOnKeyPressed { event->
+            if (event.code == KeyCode.CONTROL) {
+                controlPressed = true
+            } else if (event.code == KeyCode.S && controlPressed) {
+                controlPressed = false
+                val warning = Alert(Alert.AlertType.CONFIRMATION)
+                warning.title = "SAVE"
+                warning.contentText = "Do you want to save this file?"
+                val result = warning.showAndWait()
+                if (result.isPresent) {
+                    when (result.get()) {
+                        ButtonType.OK -> {
+                            if (newname) {
+                                while(true) {
+                                    val renaming = TextInputDialog()
+                                    renaming.headerText = "Enter new name"
+                                    val result = renaming.showAndWait()
+                                    if (result.isPresent) {
+                                        if (renaming.editor.text == "") {
+                                            val warning = Alert(Alert.AlertType.ERROR)
+                                            warning.title = "ERROR"
+                                            warning.contentText = "Empty can't be filename"
+                                            warning.showAndWait()
+                                        } else {
+                                            stage.title = renaming.editor.text
+                                            curfile.title = stage.title
+                                            newname = false
+                                            lists.addnotes(curfile.id)
+                                            break
+                                        }
+                                    } else {
+                                        break
+                                    }
+                                }
+                            }
+
+                            if(!newname) {
+                                curfile.lastModified = LocalDateTime.now().toString()
+                                curfile.text = StringBuffer(textarea.htmlText)
+                                DatabaseOperations.addUpdateNote(curfile)
+                            }
+                        }
+                    }
+                }
+            } else if (event.code == KeyCode.D && controlPressed) {
+                controlPressed = false
+                if (!lists.isbrowseropened()) {
+                    val warning = Alert(Alert.AlertType.CONFIRMATION)
+                    warning.title = "DELETE"
+                    warning.contentText = "Do you delete this file?"
+                    val result = warning.showAndWait()
+                    if (result.isPresent) {
+                        when (result.get()) {
+                            ButtonType.OK -> {
+                                DatabaseOperations.deleteNote(curfile)
+                                // filecontroller.deleteFile()
+
+//                            Database.connect("jdbc:sqlite:test.db")
+//                            transaction {
+//                                SchemaUtils.create(DatabaseOperations.Notes)
+//                                var deleteId = paramsMap["id"]?.toInt()
+//                                if (deleteId !== null && deleteId != -1) {
+//                                    DatabaseOperations.deleteNote(deleteId)
+//                                }
+//                            }
+
+                                stage.close()
+                            }
+                        }
+                    }
+                } else {
+                    val warning = Alert(Alert.AlertType.ERROR)
+                    warning.title = "ERROR"
+                    warning.contentText = "The file browser is opened elsewhere"
+                    warning.showAndWait()
+                }
+            } else if (event.code == KeyCode.W && controlPressed) {
+                controlPressed = false
+                val warning = Alert(Alert.AlertType.CONFIRMATION)
+                warning.title = "WARNING"
+                warning.contentText = "The current work will not be saved. Are you sure you want to quit?"
+                val result = warning.showAndWait()
+                if (result.isPresent) {
+                    when (result.get()) {
+                        ButtonType.OK -> {
+                            Platform.exit()
+                        }
+                    }
+                }
+            }
+        }
+
+        /**
+         * Control press logic
+         */
+        stage.scene.setOnKeyReleased {
+            if (controlPressed) {controlPressed = false}
+        }
+
+
+        stage.show()
+    }
+
+    fun settitle(passedtitle:String) {
+        stage.title = passedtitle
+    }
+
+    fun settext(content: String) {
+        textarea.htmlText = content
+    }
+
+    fun setnewname(new: Boolean) {
+        newname = new
+    }
+}
\ No newline at end of file