diff --git a/README.md b/README.md
index cf820c2..ab24115 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
 # excel-sheet-generator
 
-hello there, your task is to use sweetalert.js to display an alert when the user clicks "generate" while the fields are empty, and when the user clicks "export" but there is no generated table to be exported.
+Problem:
 
-fork the repository and start working on it.
+I am developing a web application that allows users to generate tables based on data inputted in a form. The user can then export the table as a CSV file. However, I want to ensure that the user inputs data before generating the table, and that the table is generated before allowing the user to export it.
 
-best of luck.
+Solve:
+
+I am using SweetAlert.js to display the appropriate alert messages
\ No newline at end of file
diff --git a/index.html b/index.html
index 7445a44..010813f 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,8 @@
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Bitter:wght@500&display=swap" rel="stylesheet">
+    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
+
 </head>
 <body>
     <div class="form">
diff --git a/script.js b/script.js
index bb93c4d..f1db0bb 100644
--- a/script.js
+++ b/script.js
@@ -5,25 +5,38 @@ tableExists = false
 
 const generateTable = () => {
     let rowsNumber = parseInt(rows.value), columnsNumber = parseInt(columns.value)
-    table.innerHTML = ""
-    for(let i=0; i<rowsNumber; i++){
-        var tableRow = ""
-        for(let j=0; j<columnsNumber; j++){
-            tableRow += `<td contenteditable></td>`
-        }
-        table.innerHTML += tableRow
-    }
     if(rowsNumber>0 && columnsNumber>0){
+        table.innerHTML = ""
+        for(let i=0; i<rowsNumber; i++){
+            var tableRow = ""
+            for(let j=0; j<columnsNumber; j++){
+                tableRow += `<td contenteditable></td>`
+            }
+            table.innerHTML += tableRow
+        }
         tableExists = true
+    } else {
+        Swal.fire({
+            title: 'Error',
+            text: 'Please enter the number of rows and columns.',
+            icon: 'error',
+            confirmButtonText: 'OK'
+        })
     }
 }
 
 const ExportToExcel = (type, fn, dl) => {
-    if(!tableExists){
-        return
+    if(tableExists){
+        var elt = table
+        var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" })
+        return dl ? XLSX.write(wb, { bookType: type, bookSST: true, type: 'base64' })
+            : XLSX.writeFile(wb, fn || ('MyNewSheet.' + (type || 'xlsx')))
+    } else {
+        Swal.fire({
+            title: 'Error',
+            text: 'Please generate a table before exporting.',
+            icon: 'error',
+            confirmButtonText: 'OK'
+        })
     }
-    var elt = table
-    var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" })
-    return dl ? XLSX.write(wb, { bookType: type, bookSST: true, type: 'base64' })
-        : XLSX.writeFile(wb, fn || ('MyNewSheet.' + (type || 'xlsx')))
-}
\ No newline at end of file
+}