diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a934504c564610aa4875023c2d254864ed1beb99
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
+    <data-source source="LOCAL" name="test" uuid="cb6a007e-6e7f-4c9a-a505-bedfe4fa4d0e">
+      <driver-ref>sqlite.xerial</driver-ref>
+      <synchronize>true</synchronize>
+      <jdbc-driver>org.sqlite.JDBC</jdbc-driver>
+      <jdbc-url>jdbc:sqlite:$PROJECT_DIR$/app/test.db</jdbc-url>
+      <working-dir>$ProjectFileDir$</working-dir>
+      <libraries>
+        <library>
+          <url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.40.1/sqlite-jdbc-3.40.1.jar</url>
+        </library>
+      </libraries>
+    </data-source>
+  </component>
+</project>
\ No newline at end of file
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/DatabaseOperations.kt b/utilities/src/main/kotlin/notes/multi/utilities/DatabaseOperations.kt
index abf2c122fef645c7c648e225cd6659e57e0b5e3a..a64232b48fe0da825ef4d2bb9182603d237e8592 100644
--- a/utilities/src/main/kotlin/notes/multi/utilities/DatabaseOperations.kt
+++ b/utilities/src/main/kotlin/notes/multi/utilities/DatabaseOperations.kt
@@ -5,6 +5,8 @@ import org.jetbrains.exposed.dao.id.UUIDTable
 import org.jetbrains.exposed.sql.*
 import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
 import org.jetbrains.exposed.sql.transactions.transaction
+import java.net.ConnectException
+import java.time.LocalDateTime
 
 class DatabaseOperations() {
     object Notes : Table() {
@@ -16,6 +18,12 @@ class DatabaseOperations() {
         override val primaryKey = PrimaryKey(id)
     }
 
+    object LastUpdated : Table() {
+        val id = text("id", eagerLoading = true)
+        val lastUpdate = varchar("lastUpdated", 30)
+        override val primaryKey = PrimaryKey(LastUpdated.id)
+    }
+
     companion object CRUD {
         fun addNote(note: Note) {
             transaction {
@@ -29,27 +37,31 @@ class DatabaseOperations() {
                     it[Notes.lastModified] = note.lastModified
                 } get Notes.id
             }
-            HttpOperations.post(note)
+            updateLastUpdate()
+//            try {
+//                HttpOperations.post(note)
+//            } catch (e: ConnectException) {
+//                println(e.message)
+//            }
         }
 
         fun getNote(id: String): Note {
-//            var note = Note()
-//
-//            transaction {
-//             SchemaUtils.create(DatabaseOperations.Notes)
-//                Notes.select { Notes.id eq id }.forEach {
-//                    var tempNote = Note(
-//                    it[Notes.id],
-//                    it[Notes.title],
-//                    StringBuffer(it[Notes.text]),
-//                    it[Notes.dateCreated],
-//                    it[Notes.lastModified])
-//                    note = tempNote
-//                }
-//            }
-//            return note
+            var note = Note()
 
-            return HttpOperations.get(id)
+            transaction {
+                SchemaUtils.create(DatabaseOperations.Notes)
+                Notes.select { Notes.id eq id }.forEach {
+                    var tempNote = Note(
+                    it[Notes.id],
+                    it[Notes.title],
+                    StringBuffer(it[Notes.text]),
+                    it[Notes.dateCreated],
+                    it[Notes.lastModified])
+                    note = tempNote
+                }
+            }
+            return note
+//            return HttpOperations.get(id)
         }
 
         fun updateNote(note: Note) {
@@ -63,7 +75,8 @@ class DatabaseOperations() {
                     it[Notes.lastModified] = note.lastModified
                 }
             }
-            HttpOperations.put(note)
+            updateLastUpdate()
+//            HttpOperations.put(note)
         }
 
         fun addUpdateNote(note: Note) {
@@ -92,7 +105,8 @@ class DatabaseOperations() {
 
                 Notes.deleteWhere { Notes.id eq note.id }
             }
-            HttpOperations.delete(note.id)
+            updateLastUpdate()
+//            HttpOperations.delete(note.id)
         }
 
         fun getAllNotes(): MutableList<Note> {
@@ -114,13 +128,66 @@ class DatabaseOperations() {
             }
             return listOfNotes
         }
-    }
 
+        fun deleteAllNotes() {
+            transaction {
+                SchemaUtils.drop(Notes)
+            }
+        }
+
+        fun deleteLastUpdated() {
+            transaction {
+                SchemaUtils.drop(LastUpdated)
+            }
+        }
+
+        fun deleteAll() {
+            deleteAllNotes()
+            deleteLastUpdated()
+        }
+
+        fun getLastUpdate(): String {
+            var lastUpdate: String = ""
+
+            transaction {
+                SchemaUtils.create(DatabaseOperations.LastUpdated)
+                LastUpdated.select { LastUpdated.id eq "1" }.forEach {
+                    lastUpdate = it[LastUpdated.lastUpdate]
+                }
+            }
+            return lastUpdate
+        }
+
+        fun updateLastUpdate(time: String = LocalDateTime.now().toString()) {
+            transaction {
+                deleteLastUpdated()
+                SchemaUtils.create(DatabaseOperations.LastUpdated)
+                LastUpdated.insert {
+                    it[LastUpdated.id] = "1"
+                    it[LastUpdated.lastUpdate] = time
+                }
+            }
+        }
 
-//object Folder : IntIdTable() {
-//    val folderName = varchar("folderName", 100).nullable()
-//    val notes = arrayOf(Notes.id)
-//    val dateCreated = varchar("dateCreated", 30)
-//    val lastUpdated = varchar("lastUpdated", 30)
-//}
+        fun sync(): Boolean {
+            try {
+                val remoteLastUpdate = HttpOperations.lastUpdate()
+                val localLastUpdate = getLastUpdate()
+
+                if (localLastUpdate > remoteLastUpdate) {
+                    HttpOperations.sync(DatabaseOperations.getAllNotes(), getLastUpdate())
+                } else if (localLastUpdate < remoteLastUpdate) {
+                    deleteAllNotes()
+                    for (note in HttpOperations.getAllNotes()) {
+                        addNote(note)
+                    }
+                    updateLastUpdate(HttpOperations.lastUpdate())
+                }
+                return true
+            } catch (e: ConnectException) {
+                println(e.message)
+                return false
+            }
+        }
+    }
 }
\ No newline at end of file
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt b/utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
index 9770b36efaf634e8cfc92be3d5664f24e75b6d04..719e9f5bce06d00a294e625c69eb9eeb6083edff 100644
--- a/utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
+++ b/utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
@@ -15,7 +15,7 @@ class HttpOperations {
          *  - Testing: Run web service in IntelliJ and point to "http://localhost:8080/"
          *  - Local Production: Locally deploy app using Tomcat and point to "http://localhost:8080/notes-app"
          */
-        private const val WebServiceEndpoint = "http://localhost:8080/notes-app"
+        private const val WebServiceEndpoint = "http://18.117.170.43:8080/notes-app"
         fun get(id: String = ""): Note {
             val client = HttpClient.newBuilder().build()
             val request = HttpRequest.newBuilder()
@@ -27,6 +27,26 @@ class HttpOperations {
             return Note(remoteNote!!.id, remoteNote.title, StringBuffer(remoteNote.text), remoteNote.dateCreated, remoteNote.lastModified)
         }
 
+        fun getAllNotes(): MutableList<Note> {
+            val client = HttpClient.newBuilder().build()
+            val request = HttpRequest.newBuilder()
+                .uri(URI.create("${WebServiceEndpoint}/notes/"))
+                .GET()
+                .build()
+            val response = client.send(request, HttpResponse.BodyHandlers.ofString())
+
+            val remoteNote = Klaxon().parseArray<RemoteNote>(response.body())!!.toMutableList()
+
+            val returnNote = mutableListOf<Note>()
+
+            for (note in remoteNote) {
+                val tempNote: Note = Note(note.id, note.title, StringBuffer(note.text), note.dateCreated, note.lastModified)
+                returnNote.add(tempNote)
+            }
+
+            return returnNote
+        }
+
         fun post(note: Note): String {
             val tempNote = RemoteNote(note.id, note.title, note.text.toString(), note.dateCreated, note.lastModified)
 
@@ -67,5 +87,38 @@ class HttpOperations {
 
             return response.body()
         }
+
+        fun lastUpdate(): String {
+            val client = HttpClient.newBuilder().build()
+            val request = HttpRequest.newBuilder()
+                .uri(URI.create("${WebServiceEndpoint}/lastSave/"))
+                .GET()
+                .build()
+            val response = client.send(request, HttpResponse.BodyHandlers.ofString())
+            val lastSave = Klaxon().parse<LastSave>(response.body())
+            return lastSave!!.lastUpdate
+        }
+
+        fun sync(listOfNotes: MutableList<Note>, lastUpdate: String): String {
+            val listOfRemoteNotes: MutableList<RemoteNote> = mutableListOf()
+
+            for (note in listOfNotes) {
+                val tempRemoteNote = RemoteNote(note.id, note.title, note.text.toString(), note.dateCreated, note.lastModified)
+                listOfRemoteNotes.add(tempRemoteNote)
+            }
+
+            val syncRequest = SyncRequest(lastUpdate, listOfRemoteNotes)
+
+            val jsonNote = Klaxon().toJsonString(syncRequest)
+            val client = HttpClient.newBuilder().build()
+            val request = HttpRequest.newBuilder()
+                .uri(URI.create("${WebServiceEndpoint}/sync/"))
+                .header("Content-Type", "application/json")
+                .POST(HttpRequest.BodyPublishers.ofString(jsonNote))
+                .build()
+            val response = client.send(request, HttpResponse.BodyHandlers.ofString())
+
+            return response.body()
+        }
     }
 }
\ No newline at end of file
diff --git a/utilities/src/main/kotlin/notes/multi/utilities/LastSave.kt b/utilities/src/main/kotlin/notes/multi/utilities/LastSave.kt
new file mode 100644
index 0000000000000000000000000000000000000000..47a62d3fc9176858dfdaf4a8a76b72ba30ce52bd
--- /dev/null
+++ b/utilities/src/main/kotlin/notes/multi/utilities/LastSave.kt
@@ -0,0 +1,13 @@
+package notes.multi.utilities
+
+import java.time.LocalDateTime
+
+class LastSave(
+    var id: String = "1",
+    var lastUpdate: String = LocalDateTime.now().toString()
+) {}
+
+class SyncRequest(
+    var lastUpdate: String,
+    var records: MutableList<RemoteNote>
+) {}
\ No newline at end of file