diff --git a/Backend/API/handlers/newBuilding.go b/Backend/API/handlers/newBuilding.go
index a3db5cf87adf0c3d80669730720ac42f816ce83a..c1fffbe6f9f1625112d547652e0bec39dcec943a 100644
--- a/Backend/API/handlers/newBuilding.go
+++ b/Backend/API/handlers/newBuilding.go
@@ -11,6 +11,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	// POST or add building request
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -23,6 +24,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -52,7 +54,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { // PUT or edit building request
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -65,6 +67,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		// Checks if the token is still valid
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -85,6 +88,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -111,7 +115,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { // DELETE or delete building request
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -123,6 +127,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		// Checks if the sessionToken is still active or not
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -143,6 +148,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -172,6 +178,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newCompany.go b/Backend/API/handlers/newCompany.go
index 6b31a14e6ce571dbbae518e9d84fbdd67db5f67c..da1f3cd7f0da06fc8e7a32e5a3da712ad3942ab3 100644
--- a/Backend/API/handlers/newCompany.go
+++ b/Backend/API/handlers/newCompany.go
@@ -11,7 +11,9 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.ADMIN_WEB_URL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS")
+	// POST or add company method
 	if r.Method == http.MethodPost {
+		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
 			SessionToken string `json:"sessionToken"`
 			CompanyName  string `json:"companyName"`
@@ -25,6 +27,7 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//gets permissions
 		perm, err := other.GetPermissionFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -36,10 +39,12 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//nothing can be empty of the required data
 		if data.CompanyName == "" || data.Email == "" || data.Password == "" {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//calls the function to add the company
 		err = other.InsertCompany(data.CompanyName, data.Email, data.Password)
 		if err != nil {
 			log.Println(err.Error())
@@ -50,6 +55,7 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newDepartment.go b/Backend/API/handlers/newDepartment.go
index 133db262938daee02aadea96fb12918a8e5c5411..258f45221fdb861e3fe0c91b049c8f3800698535 100644
--- a/Backend/API/handlers/newDepartment.go
+++ b/Backend/API/handlers/newDepartment.go
@@ -11,6 +11,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	// POST or add deparment method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -33,6 +35,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -66,7 +69,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { // PUT or edit department function
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -80,6 +83,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -89,6 +93,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -116,7 +121,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete department method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -128,6 +133,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -148,6 +154,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -179,6 +186,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newEnok.go b/Backend/API/handlers/newEnok.go
index 1b468789d6de3543cbd9fec82bf5c719b8e76119..7dde83e4c9eaa9943c1a35c6e99fd3b63940e230 100644
--- a/Backend/API/handlers/newEnok.go
+++ b/Backend/API/handlers/newEnok.go
@@ -11,6 +11,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add new enoek suggestion method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -44,6 +46,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -56,19 +59,19 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		// add the data to a temp struct
 		dbProcess := other.Processes{
 			Name:      data.ProcessName,
 			CompanyID: CompID,
 		}
-
+		//get the process
 		process, err := other.GetProcessIDByName(dbProcess)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
-
+		//another temp struct to store data
 		dbEnoek := other.EnokSuggestionMeasures{
 			Header:      data.Enoek.Header,
 			StartDate:   data.Enoek.StartDate,
@@ -84,7 +87,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or approve/disapprove the neoek suggestion
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -97,6 +100,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -125,7 +129,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete a enoek suggestion/post
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -137,6 +141,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -168,6 +173,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newGateway.go b/Backend/API/handlers/newGateway.go
index 5a16b13cfe1120fa7f4b9d7e7b2a23b5bcad9a45..5e8fdd8722c0564dcf8da2bffe071bb562b9858f 100644
--- a/Backend/API/handlers/newGateway.go
+++ b/Backend/API/handlers/newGateway.go
@@ -12,6 +12,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, DELETE, PUT, OPTIONS")
+	//POST or add a gateway method
 	if r.Method == http.MethodPost {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -25,7 +26,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			w.WriteHeader(http.StatusUnauthorized)
@@ -43,13 +44,14 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//adds the gateway to the database
 		err = other.AddGateway(data.Token, data.Eui, data.Name)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit gateway method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -64,6 +66,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -84,6 +87,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.Token)
 		if err != nil {
 			log.Println(err.Error())
@@ -103,7 +107,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete gateway method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -115,7 +119,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			w.WriteHeader(http.StatusUnauthorized)
@@ -125,12 +129,14 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//chirpstack request to delete the gateway
 		err = other.DoNewRequest(nil, other.CHIRP_URL+"api/gateways/"+data.Eui, http.MethodDelete)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//deletes the gateway in the database
 		err = other.DeleteGateway(data.Eui)
 		if err != nil {
 			log.Println(err.Error())
@@ -141,6 +147,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newHotdrop.go b/Backend/API/handlers/newHotdrop.go
index 76b03bb29922b74fd0998d8167c57c322cf3cbf0..e9c0a6c84b08523bdabe9c7aa4d5b964ee48d04c 100644
--- a/Backend/API/handlers/newHotdrop.go
+++ b/Backend/API/handlers/newHotdrop.go
@@ -12,6 +12,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add sensor/hotdrop method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -32,6 +33,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -41,6 +43,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -89,6 +92,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			DepartmentID: department,
 			Voltage:      data.Voltage,
 		}
+		//adds the sensor to the database
 		err = other.InsertSensor(dbMachine, 0)
 		if err != nil {
 			log.Println(err.Error())
@@ -96,7 +100,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit sensor in database
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -115,6 +119,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -124,6 +129,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -162,7 +168,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			DepartmentID: department,
 			Voltage:      data.Voltage,
 		}
-
+		//edits the sensor in database
 		err = other.EditSensor(dbMachine)
 		if err != nil {
 			log.Println(err.Error())
@@ -181,6 +187,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -190,14 +197,14 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
-
+		//Deletes the hotdrop/sensor in chirpstack
 		err = other.DoNewRequest(nil, other.CHIRP_URL+"api/devices/"+data.Eui, http.MethodDelete)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		//deletes the sensor in database
 		err = other.DeleteSensor(data.Eui)
 		if err != nil {
 			log.Println(err.Error())
@@ -208,6 +215,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newProcess.go b/Backend/API/handlers/newProcess.go
index e7b2bb03e7c237ac0715097f0473f432e4071005..ed1aaca5ca4bd4351182af1c6ac72b8fed8afb30 100644
--- a/Backend/API/handlers/newProcess.go
+++ b/Backend/API/handlers/newProcess.go
@@ -11,6 +11,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add process method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -44,6 +46,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//temp process storage
 		process := other.Processes{
 			Name:        data.ProcessName,
 			Description: data.Description,
@@ -56,7 +59,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit process method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -71,6 +74,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -91,6 +95,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -103,17 +108,20 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//old process storage
 		oldProcess := other.Processes{
 			Name:        data.ProcessName1,
 			Description: data.Description1,
 			CompanyID:   CompID,
 		}
+		//gets the id of the process that is getting edited
 		processId, err := other.GetProcessIDByName(oldProcess)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//temp storage for the new/updated process
 		newProcess := other.Processes{
 			ID:          processId,
 			Name:        data.ProcessName2,
@@ -126,7 +134,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete process method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -139,6 +147,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -159,6 +168,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -171,11 +181,13 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//temp storage for the process
 		oldProcess := other.Processes{
 			Name:        data.ProcessName,
 			Description: data.Description,
 			CompanyID:   CompID,
 		}
+		//gets the process ID for the oldprocess
 		processId, err := other.GetProcessIDByName(oldProcess)
 		if err != nil {
 			log.Println(err.Error())
@@ -192,6 +204,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
@@ -201,9 +214,9 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
 	if r.Method == "POST" {
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit process machines method
 		decoder := json.NewDecoder(r.Body)
-
+		//gets all data that is changed
 		type RequestBody struct {
 			Data []struct {
 				AddOrNot   bool   `json:"added"`
@@ -219,7 +232,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-		log.Println(requestBody.SessionToken)
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(requestBody.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -241,7 +254,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 		for _, item := range requestBody.Data {
-			//calls function to add building
+			//calls function to add or delete a connection between processes and sensors based upon the AddOrNot
 			err = other.EditSensorToProcess(item.AddOrNot, item.ProcessId, item.MachineEUI)
 			if err != nil {
 				println(err.Error())
@@ -262,6 +275,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -282,6 +296,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -315,6 +330,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newUser.go b/Backend/API/handlers/newUser.go
index e3053224dd65d1e5833675d11892f08f164c3b6c..1926d5b090d40e38348bf7f155be8165f68c0d8a 100644
--- a/Backend/API/handlers/newUser.go
+++ b/Backend/API/handlers/newUser.go
@@ -12,6 +12,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add user method
 	if r.Method == "POST" {
 		//decode all required json data
 		userData := struct {
@@ -45,8 +46,9 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//adds the user to the database
 		err = other.InsertUser(userData.SessionToken, userData.User.Email, userData.User.FirstName, userData.User.LastName, string(Hash), userData.User.Permission)
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit user method
 		//decode all required json data
 		userData := struct {
 			SessionToken string      `json:"sessionToken"`
@@ -85,7 +87,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete user method
 		userData := struct {
 			SessionToken string `json:"sessionToken"`
 			UserID       int    `json:"userID"`
@@ -119,6 +121,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/other/sqlqueries.go b/Backend/API/other/sqlqueries.go
index 87575eafe1e7cd2b66dc6651bf606ed53ca34ebd..cf35c92f7d2e936c93b729b878e86751d6374178 100644
--- a/Backend/API/other/sqlqueries.go
+++ b/Backend/API/other/sqlqueries.go
@@ -19,6 +19,7 @@ func GetUserIDFromToken(token string) (int, error) {
 	return userID, nil
 }
 
+// Gets Comapny Id by using the userID
 func GetCompanyFromUserID(userID int) (int, error) {
 	var companyID int
 	// Query to retrieve company ID based on user ID
@@ -29,6 +30,7 @@ func GetCompanyFromUserID(userID int) (int, error) {
 	return companyID, nil
 }
 
+// Gets the permission level from the session token from the user
 func GetPermissionFromToken(token string) (int, error) {
 	var permission int
 	// Query to retrieve user ID based on session token
@@ -40,6 +42,7 @@ func GetPermissionFromToken(token string) (int, error) {
 }
 
 /*USER FUNCTIONS*/
+// Insert new user with the token of the user to get the company the user is adding to
 func InsertUser(token string, email string, firstName string, lastName string, password string, permission int) error {
 
 	//gets userID
@@ -62,6 +65,8 @@ func InsertUser(token string, email string, firstName string, lastName string, p
 
 	return nil
 }
+
+// Edits the user based on new inserted values,
 func EditUser(userID int, email string, firstName string, lastName string, password string, permission int) error {
 	_, err := DB.Exec("UPDATE users SET email=?, first_name=?, last_name=?, password=?, permission=? WHERE id=?", email, firstName, lastName, password, permission, userID)
 	if err != nil {
@@ -69,6 +74,8 @@ func EditUser(userID int, email string, firstName string, lastName string, passw
 	}
 	return nil
 }
+
+// Delete user with user ID
 func DeleteUser(userID int) error {
 	_, err := DB.Exec("DELETE FROM session WHERE user_id=?", userID)
 	if err != nil {
@@ -83,6 +90,7 @@ func DeleteUser(userID int) error {
 }
 
 /*BUILDING FUNCTIONS*/
+// Insert a new building
 func InsertBuilding(token string, name string) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -102,6 +110,8 @@ func InsertBuilding(token string, name string) error {
 
 	return nil
 }
+
+// Edit an allready existing building
 func EditBuilding(id int, name string) error {
 	_, err := DB.Exec("UPDATE building set name=? WHERE id=?", name, id)
 	if err != nil {
@@ -110,6 +120,8 @@ func EditBuilding(id int, name string) error {
 
 	return nil
 }
+
+// Delete a building from its table and from every values that uses the building ID in the other tables
 func DeleteBuilding(id int) error {
 	rows, err := DB.Query("SELECT eui FROM machine WHERE building_id = ?", id)
 	if err != nil {
@@ -157,6 +169,8 @@ func DeleteBuilding(id int) error {
 
 	return nil
 }
+
+// Get building Id by its name with help of comapny ID
 func GetBuildingIdByName(name string, compId int) (int, error) {
 	var id = 0
 	row := DB.QueryRow("SELECT id FROM building WHERE name=? AND company_id=?", name, compId)
@@ -168,14 +182,16 @@ func GetBuildingIdByName(name string, compId int) (int, error) {
 }
 
 /*DEPARTMENT FUNCTIONS*/
+// Insert department for a building that exist
 func InsertDepartment(buildingID int, name string) error {
-
 	_, err := DB.Exec("INSERT INTO department (building_id, name) VALUES (?, ?)", buildingID, name)
 	if err != nil {
 		return err
 	}
 	return nil
 }
+
+// Edit existing department
 func EditDepartment(id int, name string) error {
 	_, err := DB.Exec("UPDATE department set name=? WHERE id=?", name, id)
 	if err != nil {
@@ -184,6 +200,8 @@ func EditDepartment(id int, name string) error {
 
 	return nil
 }
+
+// Delete department from department table and set it to NULL in the machines that uses it
 func DeleteDepartment(id int) error {
 	_, err := DB.Exec("UPDATE machine set department_id=NULL WHERE department_id=?", id)
 	if err != nil {
@@ -197,6 +215,8 @@ func DeleteDepartment(id int) error {
 
 	return nil
 }
+
+// Get department ID by using the company ID and name of the department
 func GetDepartmentIdByName(name string, compId int) (int, error) {
 	var id = 0
 	row := DB.QueryRow("SELECT id FROM department WHERE name=? AND building_id IN (SELECT id FROM building WHERE company_id=?)", name, compId)
@@ -208,6 +228,7 @@ func GetDepartmentIdByName(name string, compId int) (int, error) {
 }
 
 /*ENOEK FUNCTIONS*/
+// Adds a Enoek suggestion
 func InsertEnoek(token string, measures EnokSuggestionMeasures) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -221,6 +242,8 @@ func InsertEnoek(token string, measures EnokSuggestionMeasures) error {
 	}
 	return nil
 }
+
+// Makes it approved or not
 func EnoekJudgement(enoekID int, approved bool) error {
 	_, err := DB.Exec("UPDATE enoek_suggestion_measures SET approved=? WHERE id=?", approved, enoekID)
 	if err != nil {
@@ -228,6 +251,8 @@ func EnoekJudgement(enoekID int, approved bool) error {
 	}
 	return nil
 }
+
+// Says it is acitve or not
 func EnoekActiveOrNot(enoekID int, active bool) error {
 	_, err := DB.Exec("UPDATE enoek_suggestion_measures SET active=? WHERE id=?", active, enoekID)
 	if err != nil {
@@ -235,6 +260,8 @@ func EnoekActiveOrNot(enoekID int, active bool) error {
 	}
 	return nil
 }
+
+// Delete a Enoek post
 func DeleteEnoek(id int) error {
 	_, err := DB.Exec("DELETE FROM enoek_suggestion_measures WHERE id=?", id)
 	if err != nil {
@@ -244,6 +271,7 @@ func DeleteEnoek(id int) error {
 }
 
 /*COMPANY FUNCTIONS*/
+// Insert a new comapny with a admin user
 func InsertCompany(name string, email string, password string) error {
 	_, err := DB.Exec("INSERT INTO company (name) VALUES (?)", name)
 	if err != nil {
@@ -265,6 +293,8 @@ func InsertCompany(name string, email string, password string) error {
 	}
 	return nil
 }
+
+// Edit the company
 func EditCompany(id int, name string) error {
 	_, err := DB.Exec("UPDATE company SET name=? WHERE id=?", name, id)
 	if err != nil {
@@ -274,6 +304,7 @@ func EditCompany(id int, name string) error {
 }
 
 /*SENSOR FUNCTIONS*/
+// Insert a new sensor with or without a department
 func InsertSensor(machine Machine, processID int) error {
 	if machine.DepartmentID != 0 {
 		_, err := DB.Exec(`
@@ -307,6 +338,8 @@ func InsertSensor(machine Machine, processID int) error {
 
 	return nil
 }
+
+// Edit a sensor with its EUI but not able to edit the EUI
 func EditSensor(machine Machine) error {
 	if machine.DepartmentID != 0 {
 		_, err := DB.Exec(`
@@ -325,6 +358,8 @@ func EditSensor(machine Machine) error {
 	}
 	return nil
 }
+
+// Delete a sensor
 func DeleteSensor(eui string) error {
 	_, err := DB.Exec(`
 		DELETE FROM sensorData WHERE eui=?`,
@@ -347,6 +382,7 @@ func DeleteSensor(eui string) error {
 	return nil
 }
 
+// Insert sensor data that the sensors collect
 func InsertSensorData(data SensorData) error {
 	_, err := DB.Exec(`
 		INSERT INTO sensorData (eui, Acumulation, AVG_current, Offset_max, Offset_min, Voltage, Temprature, date_time)
@@ -368,6 +404,7 @@ func ClearSensorData() error {
 }
 
 /*PROCESS FUNCTIONS*/
+// Insert a new process
 func InsertProcess(token string, processes Processes) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -386,6 +423,8 @@ func InsertProcess(token string, processes Processes) error {
 	}
 	return nil
 }
+
+// Edit a process
 func EditProcess(processes Processes) error {
 	_, err := DB.Exec("UPDATE processes set name=?, description=? WHERE id=?", processes.Name, processes.Description, processes.ID)
 	if err != nil {
@@ -394,6 +433,8 @@ func EditProcess(processes Processes) error {
 
 	return nil
 }
+
+// Delete a process
 func DeleteProcess(id int) error {
 
 	_, err := DB.Exec("DELETE FROM enoek_suggestion_measures WHERE process_id=?", id)
@@ -414,6 +455,7 @@ func DeleteProcess(id int) error {
 	return nil
 }
 
+// gets process ID with its name and companyID
 func GetProcessIDByName(processes Processes) (int, error) {
 	var id = 0
 	if processes.Description != "" {
@@ -434,6 +476,7 @@ func GetProcessIDByName(processes Processes) (int, error) {
 }
 
 /*SENSOR PROCESS FUNCTIONS*/
+// Add sensor to to processMachines so that they are connected
 func AddSensorToProcess(maPro MachineProcesses) error {
 	_, err := DB.Exec("INSERT INTO machine_processes (machine_id, processes_id) VALUES (?, ?)", maPro.MachineID, maPro.ProcessesID)
 	if err != nil {
@@ -441,6 +484,8 @@ func AddSensorToProcess(maPro MachineProcesses) error {
 	}
 	return nil
 }
+
+// Adds or deletes a sensor to a process
 func EditSensorToProcess(addOrNot bool, processId int, machineEUI string) error {
 	if addOrNot {
 		_, err := DB.Exec("INSERT INTO machine_processes (machine_id, processes_id) VALUES (?, ?)", machineEUI, processId)
@@ -456,6 +501,8 @@ func EditSensorToProcess(addOrNot bool, processId int, machineEUI string) error
 
 	return nil
 }
+
+// Deletes a sensor from a process
 func DeleteSensorToProcess(maPro MachineProcesses) error {
 	_, err := DB.Exec("DELETE FROM machine_processes WHERE machine_id=? AND processes_id=? ", maPro.MachineID, maPro.ProcessesID)
 	if err != nil {
@@ -465,6 +512,7 @@ func DeleteSensorToProcess(maPro MachineProcesses) error {
 }
 
 /*GATEWAY FUNCTIONS*/
+// Adds a gateway
 func AddGateway(token string, eui string, name string) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -482,6 +530,8 @@ func AddGateway(token string, eui string, name string) error {
 	}
 	return nil
 }
+
+// edits a gateway
 func EditGateway(newEui string, oldEui string, newName string, oldName string, compId int) error {
 	_, err := DB.Exec("UPDATE gateway SET eui=?, name=? where eui=? AND name=? AND company_id=?", newEui, newName, oldEui, oldName, compId)
 	if err != nil {
@@ -489,6 +539,8 @@ func EditGateway(newEui string, oldEui string, newName string, oldName string, c
 	}
 	return nil
 }
+
+// Deltes a gateway
 func DeleteGateway(eui string) error {
 	_, err := DB.Exec("DELETE FROM gateway where eui=?", eui)
 	if err != nil {
@@ -497,6 +549,7 @@ func DeleteGateway(eui string) error {
 	return nil
 }
 
+// Functions to find out if a session token is still active or not
 func IsTokenStillActive(sessionToken string) (bool, error) {
 
 	var expires time.Time
diff --git a/Backend/EgressAPI/handlers/SensorGatewayData.go b/Backend/EgressAPI/handlers/SensorGatewayData.go
index 17b23decc79178127e1e2e5ed0e2c62568699ed8..87caf51cae511f0560e6cf3d619ba6cff1bb58ed 100644
--- a/Backend/EgressAPI/handlers/SensorGatewayData.go
+++ b/Backend/EgressAPI/handlers/SensorGatewayData.go
@@ -23,18 +23,19 @@ func SensorGatewayData(w http.ResponseWriter, r *http.Request) {
 			Sensors  []other.SensorInfo `json:"sensor"`
 			Gateways []other.Gateway    `json:"gateway"`
 		}{}
-
+		//gets the data for the sensors
 		sensors, err := other.GetSensors(token)
 		if err != nil {
 			log.Println(err.Error())
 			return
 		}
-
+		//get the data for the gateways
 		gateways, err := other.GetGateway(token)
 		if err != nil {
 			log.Println(err.Error())
 			return
 		}
+		//encode both data and send it to frontend
 		data.Sensors = sensors
 		data.Gateways = gateways
 		encoder := json.NewEncoder(w)
diff --git a/Backend/EgressAPI/handlers/SystemData.go b/Backend/EgressAPI/handlers/SystemData.go
index ccbc8f04f4f4578dbf96d3cb8097905860b3c007..dae28a53b4a5e95fa9ce92426261db8f33c1a1bb 100644
--- a/Backend/EgressAPI/handlers/SystemData.go
+++ b/Backend/EgressAPI/handlers/SystemData.go
@@ -11,6 +11,7 @@ func BuildDep(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, POST")
+	//POST or get building and department data
 	if r.Method == http.MethodPost {
 		token, err := other.ValidateRequest(r.Body)
 		if err != nil {
@@ -18,7 +19,7 @@ func BuildDep(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		//gets the building and its connected departments data connected to the company of the user of the token
 		buildingDep, err := other.GetBuildingsAndDepartments(token)
 		if err != nil {
 			log.Println(err.Error())
@@ -30,7 +31,7 @@ func BuildDep(w http.ResponseWriter, r *http.Request) {
 			BuildingDep map[string][]other.Department `json:"buildingDep"`
 			Process     []other.Processes             `json:"process"`
 		}
-
+		//sort the data for building and its departments
 		buildingDepJSON := make(map[string][]other.Department)
 		for key, value := range buildingDep {
 			departments := make([]other.Department, len(value))
@@ -44,7 +45,7 @@ func BuildDep(w http.ResponseWriter, r *http.Request) {
 		response := responseData{
 			BuildingDep: buildingDepJSON,
 		}
-
+		//sends the data to frontend
 		encoder := json.NewEncoder(w)
 		err = encoder.Encode(response)
 		if err != nil {
@@ -62,6 +63,7 @@ func Process(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, POST")
+	//POST or get process data
 	if r.Method == http.MethodPost {
 		token, err := other.ValidateRequest(r.Body)
 		if err != nil {
@@ -69,7 +71,7 @@ func Process(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		//gets the process data connected to the company of the user of the token
 		process, err := other.GetProcess(token)
 		if err != nil {
 			log.Println(err.Error())
@@ -85,7 +87,7 @@ func Process(w http.ResponseWriter, r *http.Request) {
 		response := responseData{
 			Process: process,
 		}
-
+		//sends the data to frontend
 		encoder := json.NewEncoder(w)
 		err = encoder.Encode(response)
 		if err != nil {
@@ -104,6 +106,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, POST")
+	//POST or get process and machine/sensor data
 	if r.Method == http.MethodPost {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -116,6 +119,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//Checks if sessiontoken is active or not
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -125,6 +129,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets the connected process and connected machines/sensors and all machines and their name additionally
 		processMachines, machines, err := other.GetMachinesForProcess(data.SessionToken, data.Process)
 		if err != nil {
 			log.Println(err.Error())
@@ -145,6 +150,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			var added = false
 			// Check if the machine is in processMachines
 			for _, processMachine := range processMachines {
+				//If machine is already connected to the process it returns true if not connected it returns false
 				if processMachine.MachineID == machine.EUI {
 					added = true
 					break
@@ -153,6 +159,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			// Append the result to the responseData slice
 			response.AddedOrNot = append(response.AddedOrNot, added)
 		}
+		//sends the data to front end
 		response.Machines = machines
 		encoder := json.NewEncoder(w)
 		err = encoder.Encode(response)
diff --git a/Backend/EgressAPI/handlers/enokData.go b/Backend/EgressAPI/handlers/enokData.go
index 8b173847b1901feed1ad184e5efa913e049769af..6d7c7e9c11bdf5d70f448935c35c1f82e6beb334 100644
--- a/Backend/EgressAPI/handlers/enokData.go
+++ b/Backend/EgressAPI/handlers/enokData.go
@@ -11,6 +11,7 @@ func EnoekData(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, POST")
+	//POST or get enoeks posts
 	if r.Method == http.MethodPost {
 		token, err := other.ValidateRequest(r.Body)
 		if err != nil {
@@ -59,7 +60,7 @@ func EnoekData(w http.ResponseWriter, r *http.Request) {
 				Approved:    enoeks[i].Approved,
 			})
 		}
-
+		//send data back to front end
 		encoder := json.NewEncoder(w)
 		err = encoder.Encode(data)
 		if err != nil {
diff --git a/Backend/EgressAPI/handlers/userData.go b/Backend/EgressAPI/handlers/userData.go
index 19a5447c600c842a78d7114fa15fd57b0e6a7720..835116c48bcdc51382fd94dbd7fb87e9d347ec7c 100644
--- a/Backend/EgressAPI/handlers/userData.go
+++ b/Backend/EgressAPI/handlers/userData.go
@@ -11,7 +11,9 @@ func UserData(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, POST")
+	//POST or get user data
 	if r.Method == http.MethodPost {
+		//gets token from the user
 		token, err := other.ValidateRequest(r.Body)
 		if err != nil {
 			log.Println(err.Error())
@@ -23,11 +25,24 @@ func UserData(w http.ResponseWriter, r *http.Request) {
 			Users []other.Users `json:"Users"`
 		}{}
 
+		//verify that the user making the request is allowed
+		permissionLevel, err := other.GetPermissionFromToken(token)
+		if err != nil {
+			log.Println(err.Error())
+			w.WriteHeader(http.StatusInternalServerError)
+			return
+		}
+		if permissionLevel != 0 {
+			w.WriteHeader(http.StatusUnauthorized)
+			return
+		}
+		//get the user connected to the company the token is connected to
 		users, err := other.SeeUsers(token)
 		if err != nil {
 			log.Println(err.Error())
 			return
 		}
+		//sends the data to front end
 		data.Users = users
 		encoder := json.NewEncoder(w)
 		err = encoder.Encode(data)
diff --git a/Backend/EgressAPI/other/sqlqueries.go b/Backend/EgressAPI/other/sqlqueries.go
index fb59504a3147637fbbdf54241cccaa3eb4077e97..6c65afb70771e53700e336072cb1247a7284f19a 100644
--- a/Backend/EgressAPI/other/sqlqueries.go
+++ b/Backend/EgressAPI/other/sqlqueries.go
@@ -10,6 +10,7 @@ import (
 	"time"
 )
 
+// Gets the UserID with email of the user
 func getUserIDFromEmail(email string) (int, error) {
 	var userId int
 	err := DB.QueryRow("SELECT id FROM users WHERE email = ?", email).Scan(&userId)
@@ -19,6 +20,7 @@ func getUserIDFromEmail(email string) (int, error) {
 	return userId, nil
 }
 
+// gets the hashed stored password from the email
 func GetHashedPasswordFromEmail(email string) ([]byte, error) {
 	var hashString string
 	id, err := getUserIDFromEmail(email) //get from token
@@ -34,6 +36,7 @@ func GetHashedPasswordFromEmail(email string) ([]byte, error) {
 	return hash, nil
 }
 
+// gets userID from session token
 func getUserIDFromToken(token string) (int, error) {
 	var userID int
 	// Query to retrieve user ID based on session token
@@ -43,16 +46,8 @@ func getUserIDFromToken(token string) (int, error) {
 	}
 	return userID, nil
 }
-func GetUserIDFromEmail(email string) (int, error) {
-	var userID int
-	// Query to retrieve user ID based on email
-	err := DB.QueryRow("SELECT id FROM users WHERE email = ?", email).Scan(&userID)
-	if err != nil {
-		return 0, err
-	}
-	return userID, nil
-}
 
+// Gets the company ID for a user in that company
 func getCompanyFromUserID(userID int) (int, error) {
 	var companyID int
 	// Query to retrieve company ID based on user ID
@@ -63,6 +58,7 @@ func getCompanyFromUserID(userID int) (int, error) {
 	return companyID, nil
 }
 
+// Gets the premission clearence a user has
 func GetPermissionFromToken(token string) (int, error) {
 	var permission int
 	// Query to retrieve user ID based on session token
@@ -718,6 +714,7 @@ func GetProfile(token string) ([]Profile, error) {
 	return userProfiles, nil
 }
 
+// Gets a singular user with their User ID
 func GetPerson(id int) (string, error) {
 
 	rows, err := DB.Query(`
@@ -800,6 +797,7 @@ func GetGateway(token string) ([]Gateway, error) {
 	return gatewayDatas, nil
 }
 
+// Gets all processes and its data for the user in a company thats connected to the process
 func GetProcess(token string) ([]Processes, error) {
 	//gets userID
 	userID, err := getUserIDFromToken(token)
@@ -846,6 +844,7 @@ func GetProcess(token string) ([]Processes, error) {
 	return ProcessesInfo, nil
 }
 
+// Gets all building in a company
 func GetBuilding(token string) ([]Building, error) {
 	//gets userID
 	userID, err := getUserIDFromToken(token)
@@ -891,6 +890,7 @@ func GetBuilding(token string) ([]Building, error) {
 	return BuildingInfos, nil
 }
 
+// make a session token for 24 hours
 func MakeSessionToken(email string) (string, error) {
 	tokenLength := 32
 
@@ -944,6 +944,7 @@ func isSessionTokenValid(sessionToken string) (bool, error) {
 	return exists, nil
 }
 
+// checks if the session token is still active or its expired
 func IsTokenStillActive(sessionToken string) (bool, error) {
 
 	var expires time.Time
@@ -955,6 +956,7 @@ func IsTokenStillActive(sessionToken string) (bool, error) {
 	return valid, nil
 }
 
+// deletes all session tokens that is expired before the time when this is run
 func ClearSessionTokens() {
 	_, err := DB.Exec("DELETE FROM session WHERE expires_at < ?", time.Now())
 	if err != nil {
@@ -963,6 +965,8 @@ func ClearSessionTokens() {
 	}
 	log.Println("Successfully cleared session tokens from database")
 }
+
+// Get process name with its ID
 func GetProcessNameById(id int) (string, error) {
 	var name = ""
 
diff --git a/Backend/commands.sql b/Backend/commands.sql
index 563d057b119b5684a78d9bd9af604165605f79a8..1bc79ac91b34ad89f6b86faa29c5d88739cc1316 100644
--- a/Backend/commands.sql
+++ b/Backend/commands.sql
@@ -114,11 +114,12 @@ ALTER TABLE `sensorData` ADD FOREIGN KEY (`eui`) REFERENCES `machine` (`eui`);
 
 ALTER TABLE `processes` ADD FOREIGN KEY (`company_id`) REFERENCES `company` (`id`);
 
+INSERT INTO company (`name`) VALUES ('Test');
 INSERT INTO company (`name`) VALUES ('Vyrk');
 INSERT INTO company (`name`) VALUES ('Innoveria');
 INSERT INTO company (`name`) VALUES ('Monitor');
 INSERT INTO users (`email`, `first_name`, `last_name`, `password`, `permission`, `company_id`)VALUES ('admin@admin.no', 'admin', 'admin', 'admin', 0, 1);
-INSERT INTO session VALUES ("0321412", 1, '2024-02-01 15:30:45', '2024-07-09 15:30:45');
+INSERT INTO session VALUES ('0321412', 1, '2024-02-01 15:30:45', '2024-07-09 15:30:45');
 INSERT INTO building (`company_id`, `name`) VALUES (1, 'A');
 INSERT INTO building (`company_id`, `name`) VALUES (1, 'B');
 INSERT INTO building (`company_id`, `name`) VALUES (1, 'C');
@@ -131,9 +132,8 @@ INSERT INTO department (`building_id`, `name`) VALUES (2, 'BC');
 INSERT INTO department (`building_id`, `name`) VALUES (3, 'CA');
 INSERT INTO department (`building_id`, `name`) VALUES (3, 'CB');
 INSERT INTO department (`building_id`, `name`) VALUES (3, 'CC');
-INSERT INTO machine (`eui`, `name`, `expected_use`, `machineNr`, `building_id`, `department_id`) VALUES ("E890E1CC8CF44B49", "press", 5, "4727AD", 1, 1);
-INSERT INTO processes (`name`, `description`, `company_id`) VALUES ("WINDOW", "Make window for houses", 1);
-INSERT INTO enoek_suggestion_measures (`header`, `description`, `author`, `start_date`, `stop_date`, `active`, `approved`, `process_id`) VALUES ("Oven", "Oven burn more stuff", 1, '2024-02-01 15:30:45', '2024-07-09 15:30:45', 0, NULL, 1);
-INSERT INTO machine_processes (`machine_id`, `processes_id`) VALUES ("E890E1CC8CF44B49", 1);
+INSERT INTO processes (`name`, `description`, `company_id`) VALUES ('WINDOW', 'Make window for houses', 1);
+INSERT INTO enoek_suggestion_measures (`header`, `description`, `author`, `start_date`, `stop_date`, `active`, `approved`, `process_id`) VALUES ('Oven', 'Oven burn more stuff', 1, '2024-02-01 15:30:45', '2024-07-09 15:30:45', 0, NULL, 1);
+INSERT INTO machine_processes (`machine_id`, `processes_id`) VALUES ('E890E1CC8CF44B49', 1);
 INSERT INTO sensorData (`eui`, `Acumulation`, `AVG_current`, `Offset_max`, `Offset_min`, `Voltage`, `Temprature`, `date_time`) VALUES
-  ("E890E1CC8CF44B49", 0, 0, 0, 0, 0, 0, '2024-02-11 15:30:45');
\ No newline at end of file
+  ('E890E1CC8CF44B49', 0, 0, 0, 0, 0, 0, '2024-02-11 15:30:45');
\ No newline at end of file
diff --git a/Frontend/power-tracker/.env-cmdrc.json b/Frontend/power-tracker/.env-cmdrc.json
index 0c38275d93f3f80fda890f34f2984a30abb82fde..424e4938570668c7cef3f14ba5599d20856aae74 100644
--- a/Frontend/power-tracker/.env-cmdrc.json
+++ b/Frontend/power-tracker/.env-cmdrc.json
@@ -10,8 +10,8 @@
     },
 
     "dev":{
-        "VITE_IAPI_URL": "http://localhost:9090",
-        "VITE_EAPI_URL": "http://localhost:9091",
+        "VITE_IAPI_URL": "http://192.168.0.132:9090",
+        "VITE_EAPI_URL": "http://192.168.0.132:9091",
         "GENERATE_SOURCEMAP": false
     }
 }
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/App.tsx b/Frontend/power-tracker/src/App.tsx
index 0c632c64467c8677d77817d20c90b4f8b5d6172f..1274e12d7bfcf4f4e41ccf5bfe769375e97b7bbb 100644
--- a/Frontend/power-tracker/src/App.tsx
+++ b/Frontend/power-tracker/src/App.tsx
@@ -3,6 +3,7 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
 import Login from './pages/login';
 import Overview from './pages/overview';
 import ManageGateways from './components/manageGateway'
+import { Toaster } from "@/components/ui/toaster"
 
 import { ThemeProvider } from "@/components/theme-provider"
 import ManageSensors from './pages/ManageSensors';
@@ -28,6 +29,7 @@ function App() {
             <Route path="/faq" element={<FAQ />} />
           </Routes>
       </Router>
+      <Toaster />
     </ThemeProvider>
   )
 }
diff --git a/Frontend/power-tracker/src/components/adminPages.tsx b/Frontend/power-tracker/src/components/adminPages.tsx
index b01e0c026ce4f233acc760a09ae506bd4ce9f96e..df632ce9a04f0aa7a07deff4c9738909752fb8dd 100644
--- a/Frontend/power-tracker/src/components/adminPages.tsx
+++ b/Frontend/power-tracker/src/components/adminPages.tsx
@@ -41,16 +41,19 @@ function AdminPages() {
                 <div className='navbar'>
                     <NavigationMenu>
                         <NavigationMenuList>
+                
                             <NavigationMenuItem>
                                 <NavigationMenuLink className={navigationMenuTriggerStyle()} asChild>
                                     <Link to="/admin1">User configs</Link>
                                 </NavigationMenuLink>
                             </NavigationMenuItem>
+
                             <NavigationMenuItem>
                                 <NavigationMenuLink className={navigationMenuTriggerStyle()} asChild>
                                     <Link to="/admin2">System configs</Link>
                                 </NavigationMenuLink>
                             </NavigationMenuItem>
+
                         </NavigationMenuList>
                     </NavigationMenu>
                 </div>
diff --git a/Frontend/power-tracker/src/components/enoekAdd.tsx b/Frontend/power-tracker/src/components/enoekAdd.tsx
index c294cb23fc4637232fa3f420eadc6731846236a4..30dcbac11260efb8a42c24aa07f5ad8781ee65c4 100644
--- a/Frontend/power-tracker/src/components/enoekAdd.tsx
+++ b/Frontend/power-tracker/src/components/enoekAdd.tsx
@@ -1,7 +1,4 @@
-
-import React, { useEffect, useState, useRef } from "react";
-import TopBar from '@/components/topbar';
-//import QRScan from '@/components/qr';
+import React, { useEffect, useState } from "react";
 import { redirect } from 'react-router-dom';
 import { Button } from "@/components/ui/button";
 
@@ -13,56 +10,33 @@ import {
     SelectTrigger,
     SelectValue,
 } from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
-import {
-    Table,
-    TableBody,
-    TableCaption,
-    TableCell,
-    TableHead,
-    TableHeader,
-    TableRow,
-    SortableColumnHeader,
-} from "@/components/ui/table"
 import {
     AlertDialog,
-    AlertDialogAction,
     AlertDialogCancel,
     AlertDialogContent,
-    AlertDialogDescription,
     AlertDialogFooter,
     AlertDialogHeader,
     AlertDialogTitle,
-    AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
 import {
     Form,
     FormControl,
-    FormDescription,
     FormField,
     FormItem,
     FormLabel,
-    FormMessage,
 } from "@/components/ui/form"
-import { ScrollArea } from "@/components/ui/scroll-area"
 import { z } from "zod"
 import { useForm } from "react-hook-form"
-import { zodResolver } from "@hookform/resolvers/zod"
-import { PlusIcon } from 'lucide-react';
 import { Input } from "@/components/ui/input"
-import { machine } from 'os';
 import { DatePicker } from '@/components/ui/datepicker'
+import { useToast } from "@/components/ui/use-toast"
+
 
+// making the EgressAPI and IngressAPI addresses to consts
 const EgressAPI = import.meta.env.VITE_EAPI_URL
 const IngressAPI = import.meta.env.VITE_IAPI_URL
 
+//an type for the diffrent values for enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -73,67 +47,64 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//interface value for the maincomponent
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
+//class for the data getting fetched from processes
 class Processes {
     name: string = "";
-     constructor(name: string) {
-         this.name = name; 
-     }
- }
-
-  
-
-
-  
+    constructor(name: string) {
+        this.name = name;
+    }
+}
 
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) =>{
-    const [title, setTitle] = useState("");
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
+    //start and enddate storage for the calendar pickers
     const [startDate, setStarDate] = React.useState<Date>()
     const [endDate, setEndDate] = React.useState<Date>()
-    const [description, setDescription] = useState("");
-    const [process, setProcess] = useState("");
-
+    const { toast } = useToast()
+    //usestate for the process data
     const [processData, setProcessData] = useState({
         process: [{
-          name: ""
+            name: ""
         }]
     });
+    //function to fetch processes from EgressAPI
     async function fetchDataProcess(): Promise<Processes[]> {
         var processArrray: Processes[] = []
         await axios.post(EgressAPI + '/process',
-        {
-          sessionToken: sessionStorage.getItem('TOKEN')
-        }).then((res) => {  
-            res.data.process.forEach((element: any) => {
-                processArrray.push({
-                  name: element.name
-                })
-            });
-        }).catch((error) => {
-          console.log(error)
-          setOpen(true)
-        })
-        return processArrray 
-      }
-    
+            {
+                sessionToken: sessionStorage.getItem('TOKEN')
+            }).then((res) => {
+                res.data.process.forEach((element: any) => {
+                    processArrray.push({
+                        name: element.name
+                    })
+                });
+            }).catch((error) => {
+                console.log(error)
+                setErrorOpen(true)
+            })
+        return processArrray
+    }
+
     // Assuming fetchDataProcess is an async function that fetches data
     useEffect(() => {
         fetchDataProcess().then((data) => {
-          setProcessData({
-            ...processData,
-            process: data.map((prcoesses) => ({ name: prcoesses.name }))
-        });
+            setProcessData({
+                ...processData,
+                process: data.map((prcoesses) => ({ name: prcoesses.name }))
+            });
         });
     }, []);
 
+    //Zod schema to decide the types of the values in the form
     const m_schema = z.object({
         id: z.number().int(),
         header: z.string(),
@@ -142,10 +113,10 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search })
         end_date: z.date().optional(),
         process: z.string(),
     });
-    
+
     const form = useForm<EnokDataItem>();
-    
-    
+
+    //function to call the IngressAPI to add enoek
     function addEnoek(values: z.infer<typeof m_schema>) {
         console.log(values, startDate, endDate)
         var token: string = ""
@@ -158,178 +129,145 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search })
         console.log('URL To call: ' + IngressAPI + 'token used' + token)
         axios.post(
             IngressAPI + '/new-enoek',
-            {   
+            {
                 enoek: {
                     header: values.header,
                     description: values.description,
                     start_date: startDate,
-                    stop_date:  endDate,
-                },             
+                    stop_date: endDate,
+                },
                 sessionToken: token,
                 process: values.process
             })
-        .then((res)=>{
-            console.log(res.data)
-        }).catch((error) => {
-            console.log(error)
-            setOpen(true)
-        })
+            .then((res) => {
+                console.log(res.data)
+            }).catch((error) => {
+                console.log(error)
+                setErrorOpen(true) //if error the usestate is true to show a error message
+            })
     }
-    const [open, setOpen] = useState(false);
+    //usestate to decide if to show error popup message or not
+    const [errorOpen, setErrorOpen] = useState(false);
 
+    //handeling of closing the error popup
     const handleClose = () => {
-        setOpen(false);
+        setErrorOpen(false);
     };
-    
+
 
     return (
         <>
-        <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
-        <div>
-        <Form {...form}>
-            <form onSubmit={form.handleSubmit(addEnoek)}>
-                <FormField
-                    control={form.control}
-                    name='header'
-                    render={({ field }) => (
-                        <FormItem>
-                            <FormLabel>Header</FormLabel>
-                            <FormControl>
-                                <Input  placeholder="Header" {...field} />
-                            </FormControl>
-                        </FormItem> 
-                    )}
-                />
-                <br></br>
-                <FormField
-                    control={form.control}
-                    name='description'
-                    render={({ field }) => (
-                        <FormItem>
-                            <FormLabel>Description</FormLabel>
-                            <FormControl>
-                                <textarea className={"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"} placeholder="Description" {...field} />
-                            </FormControl>
-                        </FormItem> 
-                    )}
-                />
-                <br></br>
-                <FormField
-                    control={form.control}
-                    name='start_date'
-                    render={({ field }) => (
-                        <FormItem>
-                            <FormLabel>Start Date</FormLabel>
-                            <br></br>
-                            <FormControl>
-                                <DatePicker dates={startDate} setDate={setStarDate} allowedDate={new Date()} {...field}/>
-                            </FormControl>
-                        </FormItem> 
-                    )}
-                />
-                <br></br>
-                <FormField
-                    control={form.control}
-                    name='end_date'
-                    render={({ field }) => (
-                        <FormItem>
-                            <FormLabel>Start Date</FormLabel>
-                            <br></br>
-                            <FormControl>
-                                <DatePicker dates={endDate} setDate={setEndDate} allowedDate={new Date("3000 01 01")} {...field}/>
-                            </FormControl>
-                        </FormItem> 
-                    )}
-                />
-                <FormField
-                    control={form.control}
-                    name='process'
-                    render={({ field }) => (
-                        <FormItem>
-                            <FormLabel>Process</FormLabel>
-                            <Select onValueChange={field.onChange} >
-                                <FormControl>
-                                    <SelectTrigger>
-                                        <SelectValue placeholder="Process" />
-                                    </SelectTrigger>
-                                </FormControl>
-                                <SelectContent>
-                                    { processData.process.map((name, index) => {
-                                        if (index == -1) return (<></>)
-                                        return (
-                                            name.name !== "" ? (
-                                            <SelectItem key={index} value={name.name}>{name.name}</SelectItem>
-                                            ):null
-                                        )
-                                    })}
-                                </SelectContent>
-                            </Select>
-                        </FormItem> 
-                    )}
-                />
-                <br></br>
-                 <Button type='submit'>Done</Button>
-                </form>
-        </Form>
-        {/*
-        <form onSubmit={(e) => { addEnoek(e,title,description,startDate,endDate,process); setTitle(""); setStarDate(undefined); setEndDate(undefined); setDescription(""); setProcess("");}}>
-
-        <input type="text" id="uname" value={title} onChange={(event) => setTitle(event.target.value)} placeholder="Title" required/>
-        <select name="m_buldings" id="m_building" onChange={(e) => setProcess(e.target.value)} value={process}>
-              {processData.process.map((name, index) => (
-                   name.name !== "" ? (
-                      <option key={index} value={name.name}>
-                        {name.name}
-                      </option>
-                    ) : null
-              ))}
-            </select>
-        <label>
-            Date From:
-            <DatePicker dates={startDate} setDate={setStarDate} allowedDate={new Date()}/>
-        </label> <br/> <br/>
-        <label>
-            Date To:
-            <DatePicker dates={endDate} setDate={setEndDate} allowedDate={new Date("3000 01 01")} />
-        </label> <br/> <br/>
-        <textarea id="description" value={description} onChange={(event) => setDescription(event.target.value)} placeholder="Description" required/>
-        <br/><br/>
-        <Button type='submit' onClick={() => {
-        setData(prevState => ({
-        ...prevState,
-        enoek: [
-            ...prevState.enoek,
-            {
-                id: prevState.enoek.length > 0 ? prevState.enoek[prevState.enoek.length - 1].id + 1 : 1,
-                header : title,
-                description : description,
-                author : "YOU",
-                start_date : startDate,
-                end_date : endDate,
-                active : false,
-                process : process,
-                approved : null,
-            }
-        ]
-        }));
-
-        }}>Submit Enoek!</Button>
-        </form>
-            */}
-        </div></> 
+            {/*Error message popup */}
+            {/*--------------------------*/}
+            <AlertDialog open={errorOpen}>
+                <AlertDialogContent>
+                    <AlertDialogHeader>
+                        <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+                    </AlertDialogHeader>
+                    <div>
+                        Please try again or check your connection
+                    </div>
+                    <AlertDialogFooter>
+                        <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+                    </AlertDialogFooter>
+                </AlertDialogContent>
+            </AlertDialog>
+            {/*--------------------------*/}
+            <div>
+                {/*Form get the data that should be added */}
+                <Form {...form}>
+                    <form onSubmit={form.handleSubmit(addEnoek)}>
+                        <FormField
+                            control={form.control}
+                            name='header'
+                            render={({ field }) => (
+                                <FormItem>
+                                    <FormLabel>Header</FormLabel>
+                                    <FormControl>
+                                        <Input placeholder="Header" {...field} />
+                                    </FormControl>
+                                </FormItem>
+                            )}
+                        />
+                        <br></br>
+                        <FormField
+                            control={form.control}
+                            name='description'
+                            render={({ field }) => (
+                                <FormItem>
+                                    <FormLabel>Description</FormLabel>
+                                    <FormControl>
+                                        <textarea className={"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"} placeholder="Description" {...field} />
+                                    </FormControl>
+                                </FormItem>
+                            )}
+                        />
+                        <br></br>
+                        <FormField
+                            control={form.control}
+                            name='start_date'
+                            render={({ field }) => (
+                                <FormItem>
+                                    <FormLabel>Start Date</FormLabel>
+                                    <br></br>
+                                    <FormControl>
+                                        <DatePicker dates={startDate} setDate={setStarDate} allowedDate={new Date()} {...field} />
+                                    </FormControl>
+                                </FormItem>
+                            )}
+                        />
+                        <br></br>
+                        <FormField
+                            control={form.control}
+                            name='end_date'
+                            render={({ field }) => (
+                                <FormItem>
+                                    <FormLabel>Start Date</FormLabel>
+                                    <br></br>
+                                    <FormControl>
+                                        <DatePicker dates={endDate} setDate={setEndDate} allowedDate={new Date("3000 01 01")} {...field} />
+                                    </FormControl>
+                                </FormItem>
+                            )}
+                        />
+                        <FormField
+                            control={form.control}
+                            name='process'
+                            render={({ field }) => (
+                                <FormItem>
+                                    <FormLabel>Process</FormLabel>
+                                    <Select onValueChange={field.onChange} >
+                                        <FormControl>
+                                            <SelectTrigger>
+                                                <SelectValue placeholder="Process" />
+                                            </SelectTrigger>
+                                        </FormControl>
+                                        <SelectContent>
+                                            {processData.process.map((name, index) => {
+                                                if (index == -1) return (<></>)
+                                                return (
+                                                    name.name !== "" ? (
+                                                        <SelectItem key={index} value={name.name}>{name.name}</SelectItem>
+                                                    ) : null
+                                                )
+                                            })}
+                                        </SelectContent>
+                                    </Select>
+                                </FormItem>
+                            )}
+                        />
+                        <br></br>
+                        <Button type='submit' 
+                 onClick={()=>{
+                    toast({
+                        title: "Added Measure.",
+                    })
+                 }}>
+                    Done</Button>
+                    </form>
+                </Form>
+            </div></>
     );
 };
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekAktiv.tsx b/Frontend/power-tracker/src/components/enoekAktiv.tsx
index 97669b1c7c286774ad2e8c5dfcfd2b378d967a65..745183eeb6675cd2c77e8220dbcd4bf0d38e82f1 100644
--- a/Frontend/power-tracker/src/components/enoekAktiv.tsx
+++ b/Frontend/power-tracker/src/components/enoekAktiv.tsx
@@ -1,28 +1,7 @@
-import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
-import axios from 'axios';
-import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -30,28 +9,9 @@ import {
     TableRow,
     SortableColumnHeader,
 } from "@/components/ui/table"
-import {
-    AlertDialog,
-    AlertDialogAction,
-    AlertDialogCancel,
-    AlertDialogContent,
-    AlertDialogDescription,
-    AlertDialogFooter,
-    AlertDialogHeader,
-    AlertDialogTitle,
-    AlertDialogTrigger,
-} from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -62,35 +22,36 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//the type of data the Maincomponent resives 
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
-
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
+    //use state to keep track of which table column is sorted
     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+    //use state to keep track of which sort direction is used
     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
 
     const handleClick = (column: string) => {
         if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+            // Toggle sort direction if clicking on the same column
+            setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
         } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
+            // Set new sorted column and reset sort direction
+            setCurrentSortedColumn(column);
+            setSortDirection('asc');
         }
     };
 
     return (
         <>
 
-        <ScrollArea>
+            <ScrollArea>
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -98,106 +59,108 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
-
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-                data.start_date != undefined && data.end_date != undefined&& new Date()>=new Date(data.start_date) && new Date()<=new Date(data.end_date)&& data.approved && (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                        {/*Table column names */}
+                        <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null, if the current date is between start and end date of the enoek suggestion, if its approved and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && new Date() >= new Date(data.start_date) && new Date() <= new Date(data.end_date) && data.approved && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
-    
-  
-  export default MainComponent
\ No newline at end of file
+
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekAllMeasures.tsx b/Frontend/power-tracker/src/components/enoekAllMeasures.tsx
index f46eebaa5ad8f0d83d86f5a600de7d01b609ebce..c4ed8de6f8c30ee30af69486fd058ba8dc09065d 100644
--- a/Frontend/power-tracker/src/components/enoekAllMeasures.tsx
+++ b/Frontend/power-tracker/src/components/enoekAllMeasures.tsx
@@ -1,29 +1,11 @@
-
 import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
 import axios from 'axios';
 import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
+import { useToast } from "@/components/ui/use-toast"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -42,20 +24,13 @@ import {
     AlertDialogTitle,
     AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//make a const that has the IngressAPI ip
 const IngressAPI = import.meta.env.VITE_IAPI_URL
 
 
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -66,32 +41,35 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//the type of data the Maincomponent resives 
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
 
-    const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
-    const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
+     //use state to keep track of which table column is sorted
+     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+     //use state to keep track of which sort direction is used
+     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
+     const { toast } = useToast()
+
+     const handleClick = (column: string) => {
+         if (currentSortedColumn === column) {
+             // Toggle sort direction if clicking on the same column
+             setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+         } else {
+             // Set new sorted column and reset sort direction
+             setCurrentSortedColumn(column);
+             setSortDirection('asc');
+         }
+     };
+    const deleteEnoek = (id: number) => {
 
-    const handleClick = (column: string) => {
-        if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
-        } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
-        }
-    };
-    const deleteEnoek = ( id: number) =>  {
-      
         var token: string = ""
         var tokenBool = sessionStorage.getItem("TOKEN")
         if (tokenBool == null) {
@@ -102,44 +80,49 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
         console.log('URL To call: ' + IngressAPI + 'token used' + token)
         axios.delete(
             IngressAPI + '/new-enoek',
-            {   
-              data:{
-                id: id,
-                sessionToken: token
+            {
+                data: {
+                    id: id,
+                    sessionToken: token
                 }
             })
-        .then((res)=>{
-            console.log(res.data)
-        }).catch((error) => {
-            console.log(error)
-            setOpen(true)
-        })
-      }
-      const permission = sessionStorage.getItem('PERMISSION');
-
-      const [open, setOpen] = useState(false);
+            .then((res) => {
+                console.log(res.data)
+            }).catch((error) => {
+                console.log(error)
+                setErrorOpen(true)
+            })
+    }
+    //gets the permission level of the user
+    const permission = sessionStorage.getItem('PERMISSION');
 
+    //Usestate to store if the error popup should be shown or not
+    const [errorOpen, setErrorOpen] = useState(false);
+     //handles the closing of the error popup
     const handleClose = () => {
-        setOpen(false);
+        setErrorOpen(false);
     };
 
     return (
         <>
 
-        <ScrollArea>
-        <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+            <ScrollArea>
+                {/*Error message popup */}
+                 {/*--------------------------*/}
+                 <AlertDialog open={errorOpen}>
+                    <AlertDialogContent>
+                        <AlertDialogHeader>
+                            <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+                        </AlertDialogHeader>
+                        <div>
+                            Please try again or check your connection
+                        </div>
+                        <AlertDialogFooter>
+                            <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+                        </AlertDialogFooter>
+                    </AlertDialogContent>
+                </AlertDialog>
+                 {/*--------------------------*/}
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -147,121 +130,129 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
+                        {/*Table column names */}
+                        <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
 
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-            data.start_date != undefined && data.end_date != undefined && (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                     
-                    {(permission && parseInt(permission, 10) <= 1) && (
-                        <>
-                        <br></br>
-                        <AlertDialog>
-                        <AlertDialogTrigger asChild>
-                            <Button size="sm" variant="outline">Delete</Button>
-                        </AlertDialogTrigger>
-                            <AlertDialogContent>
-                                <AlertDialogTitle>Delete enoek suggestion?</AlertDialogTitle>
-                                <AlertDialogDescription>Do you want to delete {data.author}'s post about {data.header}?</AlertDialogDescription>
-                                <AlertDialogAction onClick={() => {deleteEnoek(data.id); }}>DELETE</AlertDialogAction>
-                                <AlertDialogCancel >Cancel</AlertDialogCancel>
-                            </AlertDialogContent>
-                        </AlertDialog></>
-                     )}
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                                {(permission && parseInt(permission, 10) <= 1) && (
+                                    <>
+                                        <br></br>
+                                        {/*Delete button to delete that enoek suggestion */}
+                                        <AlertDialog>
+                                            <AlertDialogTrigger asChild>
+                                                <Button size="sm" variant="outline">Delete</Button>
+                                            </AlertDialogTrigger>
+                                            <AlertDialogContent>
+                                                <AlertDialogTitle>Delete enoek suggestion?</AlertDialogTitle>
+                                                <AlertDialogDescription>Do you want to delete {data.author}'s post about {data.header}?</AlertDialogDescription>
+                                                <AlertDialogAction onClick={() => { 
+                                    deleteEnoek(data.id); 
+                                    toast({
+                                        title: "Deleted Measure.",
+                                    })
+                                }}>DELETE</AlertDialogAction>
+                                                <AlertDialogCancel >Cancel</AlertDialogCancel>
+                                            </AlertDialogContent>
+                                        </AlertDialog></>
+                                )}
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekApprovedMeasures.tsx b/Frontend/power-tracker/src/components/enoekApprovedMeasures.tsx
index 70a6db4f3b315411f9dccfa04aea2af441baf097..0de914f946a47e2b07843cc6b9567ef9b1554aab 100644
--- a/Frontend/power-tracker/src/components/enoekApprovedMeasures.tsx
+++ b/Frontend/power-tracker/src/components/enoekApprovedMeasures.tsx
@@ -1,29 +1,8 @@
 
-import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
-import axios from 'axios';
-import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -31,28 +10,9 @@ import {
     TableRow,
     SortableColumnHeader,
 } from "@/components/ui/table"
-import {
-    AlertDialog,
-    AlertDialogAction,
-    AlertDialogCancel,
-    AlertDialogContent,
-    AlertDialogDescription,
-    AlertDialogFooter,
-    AlertDialogHeader,
-    AlertDialogTitle,
-    AlertDialogTrigger,
-} from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -63,35 +23,36 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//the type of data the Maincomponent resives 
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
-
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
+    //use state to keep track of which table column is sorted
     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+    //use state to keep track of which sort direction is used
     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
 
     const handleClick = (column: string) => {
         if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+            // Toggle sort direction if clicking on the same column
+            setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
         } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
+            // Set new sorted column and reset sort direction
+            setCurrentSortedColumn(column);
+            setSortDirection('asc');
         }
     };
 
     return (
         <>
 
-        <ScrollArea>
+            <ScrollArea>
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -99,106 +60,108 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
-
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-                data.start_date != undefined && data.end_date != undefined && data.approved&& (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                        {/*Table column names */}
+                        <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null, the enoek suggetion is approved or true and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && data.approved && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
 
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekDecision.tsx b/Frontend/power-tracker/src/components/enoekDecision.tsx
index fcabd504d1e1def1de17970118bd762a9afc4d42..46b579117bbcbf95d61de7100a76125d11185fa8 100644
--- a/Frontend/power-tracker/src/components/enoekDecision.tsx
+++ b/Frontend/power-tracker/src/components/enoekDecision.tsx
@@ -1,28 +1,11 @@
 import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
 import axios from 'axios';
 import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
+import { useToast } from "@/components/ui/use-toast"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -32,27 +15,18 @@ import {
 } from "@/components/ui/table"
 import {
     AlertDialog,
-    AlertDialogAction,
     AlertDialogCancel,
     AlertDialogContent,
-    AlertDialogDescription,
     AlertDialogFooter,
     AlertDialogHeader,
     AlertDialogTitle,
-    AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//make a const that has the IngressAPI ip
 const IngressAPI = import.meta.env.VITE_IAPI_URL
+
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -63,44 +37,44 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
-    enoek: EnokDataItem[];
-    setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
-    search: string;
-}
+//the type of data the Maincomponent resives 
 interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
 
-    const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
-    const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
-
-    const handleClick = (column: string) => {
-        if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
-        } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
-        }
-    };
-    const [open, setOpen] = useState(false);
+     //use state to keep track of which table column is sorted
+     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+     //use state to keep track of which sort direction is used
+     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
+ 
+     const handleClick = (column: string) => {
+         if (currentSortedColumn === column) {
+             // Toggle sort direction if clicking on the same column
+             setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+         } else {
+             // Set new sorted column and reset sort direction
+             setCurrentSortedColumn(column);
+             setSortDirection('asc');
+         }
+     };
+     //Usestate to store if the error popup should be shown or not
+    const [errorOpen, setErrorOpen] = useState(false);
+     //handles the closing of the error popup
+    const { toast } = useToast()
 
     const handleClose = () => {
-        setOpen(false);
+        setErrorOpen(false);
     };
-
-    const judge = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, id: number, bool: boolean) =>  {
+    //API call to either approve or reject an enoek suggestion
+    const judge = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, id: number, bool: boolean) => {
         e.preventDefault()
-    
+
         var token: string = ""
         var tokenBool = sessionStorage.getItem("TOKEN")
         if (tokenBool == null) {
@@ -111,35 +85,38 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
         console.log('URL To call: ' + IngressAPI + 'token used' + token)
         axios.put(
             IngressAPI + '/new-enoek',
-            {   
+            {
                 id: id,
                 bool: bool,
-                sessionToken:token,
+                sessionToken: token,
+            })
+            .then((res) => {
+                console.log(res.data)
+            }).catch((error) => {
+                console.log(error)
+                setErrorOpen(true)
             })
-        .then((res)=>{
-            console.log(res.data)
-        }).catch((error) => {
-            console.log(error)
-            setOpen(true)
-        })
     }
     return (
         <>
 
-        <ScrollArea>
-        <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+            <ScrollArea>
+                 {/*Error message popup */}
+                 {/*--------------------------*/}
+                <AlertDialog open={errorOpen}>
+                    <AlertDialogContent>
+                        <AlertDialogHeader>
+                            <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+                        </AlertDialogHeader>
+                        <div>
+                            Please try again or check your connection
+                        </div>
+                        <AlertDialogFooter>
+                            <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+                        </AlertDialogFooter>
+                    </AlertDialogContent>
+                </AlertDialog>
+                 {/*--------------------------*/}
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -147,109 +124,121 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
-
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-                data.start_date != undefined && data.end_date != undefined && data.approved==null&& (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                     <br></br>
-                     <Button size="sm" variant="outline" onClick={(e)=>{judge(e,data.id,true)}}>approve</Button>
-                     <Button size="sm" variant="outline" onClick={(e)=>{judge(e,data.id,false)}}>reject</Button>
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                       {/*Table column names */}
+                       <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null, the enoek suggetion is null meaning it hasnt been approved or dissaproved yet and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && data.approved == null && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
+                                <br></br>
+                                <Button size="sm" variant="outline" onClick={(e) => { 
+                        judge(e, data.id, true) 
+                        toast({
+                            title: "Approved Measure.",
+                        })
+                        }}>approve</Button>
+                                <Button size="sm" variant="outline" onClick={(e) => { 
+                        judge(e, data.id, false) 
+                        toast({
+                            title: "Rejected Measure.",
+                        })
+                        }}>reject</Button>
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
 
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekMyMeasures.tsx b/Frontend/power-tracker/src/components/enoekMyMeasures.tsx
index de449e033fa3f5013d929075c3a54d7afa08bac8..868b69116f47167e65534e3dd47c5002be731484 100644
--- a/Frontend/power-tracker/src/components/enoekMyMeasures.tsx
+++ b/Frontend/power-tracker/src/components/enoekMyMeasures.tsx
@@ -1,28 +1,7 @@
-import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
-import axios from 'axios';
-import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -30,28 +9,9 @@ import {
     TableRow,
     SortableColumnHeader,
 } from "@/components/ui/table"
-import {
-    AlertDialog,
-    AlertDialogAction,
-    AlertDialogCancel,
-    AlertDialogContent,
-    AlertDialogDescription,
-    AlertDialogFooter,
-    AlertDialogHeader,
-    AlertDialogTitle,
-    AlertDialogTrigger,
-} from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -62,35 +22,37 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//the type of data the Maincomponent resives 
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
 
+    //use state to keep track of which table column is sorted
     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+    //use state to keep track of which sort direction is used
     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
 
     const handleClick = (column: string) => {
         if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+            // Toggle sort direction if clicking on the same column
+            setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
         } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
+            // Set new sorted column and reset sort direction
+            setCurrentSortedColumn(column);
+            setSortDirection('asc');
         }
     };
 
     return (
         <>
 
-        <ScrollArea>
+            <ScrollArea>
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -98,107 +60,109 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
-
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-                data.start_date != undefined && data.end_date != undefined && (sessionStorage.getItem("FIRSTNAME") + " " + sessionStorage.getItem("LASTNAME"))==data.author&& (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                        {/*Table column names */}
+                        <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null, the user is the author and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && (sessionStorage.getItem("FIRSTNAME") + " " + sessionStorage.getItem("LASTNAME")) == data.author && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
 
-   
-  
-  export default MainComponent
\ No newline at end of file
+
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/enoekRejectedMeasures.tsx b/Frontend/power-tracker/src/components/enoekRejectedMeasures.tsx
index 4a00dc5470badf18fe26e33a9c5b76743c8f0f43..9db4594777bf6704774a26056490ec94494ef7ee 100644
--- a/Frontend/power-tracker/src/components/enoekRejectedMeasures.tsx
+++ b/Frontend/power-tracker/src/components/enoekRejectedMeasures.tsx
@@ -1,28 +1,7 @@
-import { Button } from "@/components/ui/button";
-import { DatePicker } from '@/components/ui/datepicker'
 import React from "react";
 import { useState } from "react";
-import axios from 'axios';
-import { redirect } from 'react-router-dom';
-import { date } from "zod";
-import {
-    Select,
-    SelectContent,
-    SelectItem,
-    SelectTrigger,
-    SelectValue,
-} from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
 import {
     Table,
-    TableBody,
     TableCaption,
     TableCell,
     TableHead,
@@ -30,28 +9,9 @@ import {
     TableRow,
     SortableColumnHeader,
 } from "@/components/ui/table"
-import {
-    AlertDialog,
-    AlertDialogAction,
-    AlertDialogCancel,
-    AlertDialogContent,
-    AlertDialogDescription,
-    AlertDialogFooter,
-    AlertDialogHeader,
-    AlertDialogTitle,
-    AlertDialogTrigger,
-} from "@/components/ui/alert-dialog"
-import {
-    Form,
-    FormControl,
-    FormDescription,
-    FormField,
-    FormItem,
-    FormLabel,
-    FormMessage,
-} from "@/components/ui/form"
 import { ScrollArea } from "@/components/ui/scroll-area"
 
+//Type for the enoek data
 type EnokDataItem = {
     id: number;
     header: string;
@@ -62,35 +22,36 @@ type EnokDataItem = {
     active: boolean;
     process: string;
     approved: boolean | null; // Nullable boolean
-  };
-  
+};
 
-  interface ManageAddingProps {
+//the type of data the Maincomponent resives 
+interface ManageAddingProps {
     enoek: EnokDataItem[];
     setData: React.Dispatch<React.SetStateAction<{ enoek: EnokDataItem[] }>>;
     search: string;
 }
 
-const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =>{
-
+const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search }) => {
+    //use state to keep track of which table column is sorted
     const [currentSortedColumn, setCurrentSortedColumn] = useState<string | null>(null);
+    //use state to keep track of which sort direction is used
     const [sortDirection, setSortDirection] = useState<'asc' | 'desc' | null>(null);
 
     const handleClick = (column: string) => {
         if (currentSortedColumn === column) {
-        // Toggle sort direction if clicking on the same column
-        setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
+            // Toggle sort direction if clicking on the same column
+            setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
         } else {
-        // Set new sorted column and reset sort direction
-        setCurrentSortedColumn(column);
-        setSortDirection('asc');
+            // Set new sorted column and reset sort direction
+            setCurrentSortedColumn(column);
+            setSortDirection('asc');
         }
     };
 
     return (
         <>
 
-        <ScrollArea>
+            <ScrollArea>
                 <Table>
                     <TableCaption>
                         (づ ◕‿◕ )づ
@@ -98,105 +59,107 @@ const MainComponent: React.FC<ManageAddingProps> = ({ enoek, setData, search}) =
                         <br />
                     </TableCaption>
                     <TableHeader className="">
-                    <TableRow>
-                    <SortableColumnHeader
-                        column="description"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Description
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="author"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Author
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="startDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Start Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="endDate"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    End Date
-                    </SortableColumnHeader>
-                    <SortableColumnHeader
-                        column="process"
-                        currentSortedColumn={currentSortedColumn}
-                        sortDirection={sortDirection}
-                        onClick={handleClick}
-                    >
-                    Process
-                    </SortableColumnHeader>
-                        <TableHead></TableHead>
-                    </TableRow>
-                </TableHeader>
-            {enoek.sort((a,b)=>{
-                // Ensure currentSortedColumn is defined and not null
-                if (!currentSortedColumn) {
-                    return 0; 
-                }
-                var valueA;
-                var valueB;
-
-                switch (currentSortedColumn) {
-                    case "description":
-                        valueA = a.header.toLowerCase();
-                        valueB = b.header.toLowerCase();
-                        break;
-                    case "author":
-                        valueA = a.author.toLowerCase();
-                        valueB = b.author.toLowerCase();
-                        break;
-                    case "startDate":
-                        valueA = a.start_date;
-                        valueB = b.start_date;
-                        break;
-                    case "endDate":
-                        valueA = a.end_date;
-                        valueB = b.end_date;
-                        break;
-                    case "process":
-                        valueA = a.process;
-                        valueB = b.process;
-                        break;
-                    default:
-                        return 0; // No sorting if currentSortedColumn is not recognized
-                }
-                // Compare the values
-                if (valueA === undefined || valueB === undefined) {
-                    return 0; // No sorting if valueA or valueB is undefined
-                } else {
-                    // Use ternary operator to decide the comparison direction based on sortDirection
-                    const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
-                    return sortDirection === "asc" ? comparison : -comparison;
-                }
-            }).map((data, index) => (
-                data.start_date != undefined && data.end_date != undefined && data.approved===false&& (data.header.toLowerCase().includes(search.toLowerCase())||data.author.toLowerCase().includes(search.toLowerCase()))?
-                <TableRow key={index}>
-                    <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
-                     <TableCell>{data.author}</TableCell>
-                     <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
-                     <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
-                     <TableCell>{data.process}</TableCell>
-                </TableRow>
-                : null
-            ))}
-            </Table>
-        </ScrollArea>
-        </> 
+                        {/*Table column names */}
+                        <TableRow>
+                            <SortableColumnHeader
+                                column="description"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Description
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="author"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Author
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="startDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Start Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="endDate"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                End Date
+                            </SortableColumnHeader>
+                            <SortableColumnHeader
+                                column="process"
+                                currentSortedColumn={currentSortedColumn}
+                                sortDirection={sortDirection}
+                                onClick={handleClick}
+                            >
+                                Process
+                            </SortableColumnHeader>
+                            <TableHead></TableHead>
+                        </TableRow>
+                    </TableHeader>
+                    {/*Sort the data being show based upon the sorting direction and the column that is suppose to be sorted */}
+                    {enoek.sort((a, b) => {
+                        if (!currentSortedColumn) {
+                            return 0;
+                        }
+                        var valueA;
+                        var valueB;
+                        //desides the values based on which column being sorted
+                        switch (currentSortedColumn) {
+                            case "description":
+                                valueA = a.header.toLowerCase();
+                                valueB = b.header.toLowerCase();
+                                break;
+                            case "author":
+                                valueA = a.author.toLowerCase();
+                                valueB = b.author.toLowerCase();
+                                break;
+                            case "startDate":
+                                valueA = a.start_date;
+                                valueB = b.start_date;
+                                break;
+                            case "endDate":
+                                valueA = a.end_date;
+                                valueB = b.end_date;
+                                break;
+                            case "process":
+                                valueA = a.process;
+                                valueB = b.process;
+                                break;
+                            default:
+                                return 0; // No sorting if currentSortedColumn is not recognized
+                        }
+                        // Compare the values
+                        if (valueA === undefined || valueB === undefined) {
+                            return 0; // No sorting if valueA or valueB is undefined
+                        } else {
+                            //decide the comparison direction based on sortDirection
+                            const comparison = valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
+                            return sortDirection === "asc" ? comparison : -comparison;
+                        }
+                    }).map((data, index) => (
+                        //if values isnt undefined/null, the enoek suggetion is rejected or false and it includes what the user search for, display that part of data
+                        data.start_date != undefined && data.end_date != undefined && data.approved === false && (data.header.toLowerCase().includes(search.toLowerCase()) || data.author.toLowerCase().includes(search.toLowerCase())) ?
+                            <TableRow key={index}>
+                                <TableCell><strong>{data.header}</strong> <br></br>{data.description}</TableCell>
+                                <TableCell>{data.author}</TableCell>
+                                <TableCell>{new Date(data.start_date).toDateString()}</TableCell>
+                                <TableCell>{new Date(data.end_date).toDateString()}</TableCell>
+                                <TableCell>{data.process}</TableCell>
+                            </TableRow>
+                            : null
+                    ))}
+                </Table>
+            </ScrollArea>
+        </>
     );
 };
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/manageBuildDep.tsx b/Frontend/power-tracker/src/components/manageBuildDep.tsx
index 35f0600c2af3fd532d2f073934866e896526da2b..f7f502a310a327bcbda3c88078bf11351dab40ad 100644
--- a/Frontend/power-tracker/src/components/manageBuildDep.tsx
+++ b/Frontend/power-tracker/src/components/manageBuildDep.tsx
@@ -25,8 +25,9 @@ import {
 } from "@/components/ui/accordion"
 import { Factory } from 'lucide-react';
 import { Warehouse } from 'lucide-react';
-import { Pencil } from 'lucide-react';
 import { Label } from '@radix-ui/react-label';
+import { ToastAction } from "@/components/ui/toast"
+import { useToast } from "@/components/ui/use-toast"
 
 
 const EgressAPI = import.meta.env.VITE_EAPI_URL
@@ -356,7 +357,7 @@ const usePopoutState = () => {
 	const [isPopoutOpen, setPopoutOpen] = useState(false);
 	const [whatOperation, setOperation] = useState(0);
 	const [assignValue, setassignValue] = useState(0);
-
+	
 
 
 	const handleOpenPopout = () => {
@@ -390,24 +391,29 @@ interface ManagePopup {
 interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 	data: BuildDepData;
 	setData: SetBuildDepData;
-}
-
-
+	}	
+	
+	const { toast } = useToast()
+	
 	return (
 		<div className='flex h-[100%]'>
-            <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+
+
+			{/* Page display error */}
+			<AlertDialog open={open}>
+				<AlertDialogContent>
+					<AlertDialogHeader>
+						<AlertDialogTitle>Something went wrong</AlertDialogTitle>
+					</AlertDialogHeader>
+					<div>
+						Please try again or check your connection
+					</div>
+					<AlertDialogFooter>
+						<AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+					</AlertDialogFooter>
+				</AlertDialogContent>
+			</AlertDialog>
+
 			<div className='w-[1100px]'>
 				{/* Title and search bar */}
 				<div className="w-[100%] h-[40px] flex justify-between content-center" style={{ marginTop: '5px' }}>
@@ -423,39 +429,44 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 
 				<Separator className="mb-[10px]" />	
 
-				{/* New building button */}
+				{/* New building button and window */}
 				<AlertDialog>
+					{/* New building Button */}
 					<AlertDialogTrigger> 
 						<Button className="w-[60px] h-[30px] mb-[10px] ml-[10px]" variant="default" size="icon" onClick={() => { setBuildingBool(!buildingBool)}} title="Add Building">
 							<Factory className="h-[20px]" />
 							<Plus className="h-[18px]" />
 						</Button>
 					</AlertDialogTrigger>
+					{/* New Building window */}
 					<AlertDialogContent>
 						<form onSubmit={(e) => { if(buildingNameInput!=""){addBuilding(e,buildingNameInput); setBuildingNameInput(""); setBuildingBool(!buildingBool);}}} className="form-container">
-						<Input className="mb-[20px]" type="text" placeholder="Buidling Name" value={buildingNameInput} onChange={(event) => setBuildingNameInput(event.target.value)} required/>
-						<AlertDialogFooter>
-							<AlertDialogAction>
-								<Button 
-									type="submit" 
-									onClick={() => {
-									setBuildDepData(prevState => ({
-									...prevState,
-									buildingDepartmentData: [
-										...prevState.buildingDepartmentData,
-										{
-											building: {
-												name: buildingNameInput
-											},
-											departments: []
-										}
-									]
-									}));
-								}}>Submit
-								</Button>
-							</AlertDialogAction>
-							<AlertDialogCancel>Cancel</AlertDialogCancel>
-						</AlertDialogFooter>
+							<Input className="mb-[20px]" type="text" placeholder="Buidling Name" value={buildingNameInput} onChange={(event) => setBuildingNameInput(event.target.value)} required/>
+							<AlertDialogFooter>
+								<AlertDialogAction>
+									<Button 
+										type="submit" 
+										onClick={() => {
+										setBuildDepData(prevState => ({
+										...prevState,
+										buildingDepartmentData: [
+											...prevState.buildingDepartmentData,
+											{
+												building: {
+													name: buildingNameInput
+												},
+												departments: []
+											}
+										]
+										}));
+										toast({
+											title: "Added Building.",
+										})
+									}}>Submit
+									</Button>
+								</AlertDialogAction>
+								<AlertDialogCancel>Cancel</AlertDialogCancel>
+							</AlertDialogFooter>
 						</form>
 					</AlertDialogContent>
 				</AlertDialog>	
@@ -487,7 +498,14 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 												<AlertDialogHeader>Edit {buildDep.building.name}</AlertDialogHeader>
 												<form onSubmit={(e)=>{e.preventDefault();editBuilding(buildDep.building.name, buildingNameInput); setBuildingNameInput("")}}>
 													<Input className="mb-[20px]" type="text" placeholder="Buidling Name" value={buildingNameInput} onChange={(event) => setBuildingNameInput(event.target.value)} required/>
-													<AlertDialogAction type='submit'>Confirm</AlertDialogAction>
+													<AlertDialogAction 
+														type='submit' 
+														onClick={() => {
+															toast({
+																title: "Edited Building.",
+															})
+														}}>Confirm
+													</AlertDialogAction>
 													<AlertDialogCancel onClick={()=>{setBuildingNameInput("")}}>Cancel</AlertDialogCancel>
 												</form>
 											</AlertDialogContent>
@@ -498,7 +516,13 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 											</AlertDialogTrigger>
 											<AlertDialogContent> 
 												<AlertDialogHeader>Are you sure about deleting {buildDep.building.name} and all its machines and departments?</AlertDialogHeader>
-												<AlertDialogAction onClick={()=>deleteBuilding(buildDep.building.name)}>DELETE</AlertDialogAction>
+												<AlertDialogAction 
+													onClick={()=> {
+														deleteBuilding(buildDep.building.name); 
+														toast({
+															title: "Deleted Building.",
+													  })}}>DELETE
+												</AlertDialogAction>
 												<AlertDialogCancel>Cancel</AlertDialogCancel>
 											</AlertDialogContent>
 										</AlertDialog>
@@ -508,10 +532,11 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 								</div>
 								{/* In building dropdown */}
 								<AccordionContent>
-								{/* Add department button */}	
+								{/* Add department button and window*/}	
 								<div className="depbar">
 									<Separator orientation='vertical' className="mr-[5px]"/>
 									<AlertDialog>
+										{/* Add department button */}
 										<AlertDialogTrigger asChild>
 											<Button className="w-[60px] h-[30px] mb-[10px] ml-[20px] mt-[10px]" variant="default" size="icon" onClick={() => {
 														setDepartmentBool(!departmentBool);
@@ -523,6 +548,7 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 												<Plus className="h-[18px]" />
 											</Button>
 										</AlertDialogTrigger>
+										{/* Add department window */}
 										<AlertDialogContent> 
 											<form onSubmit={(e) => {
 												e.preventDefault();
@@ -589,9 +615,11 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 												<div/>
 												<div className="h-[100%] flex items-center justify-around">
 													<AlertDialog>
+														{/* Edit Department button */}
 														<AlertDialogTrigger asChild>
 															<Button className="h-[30px] w-[60px]" variant="outline" onClick={()=>{setDepartmentNameInput(department.name)}}>Edit</Button>
 														</AlertDialogTrigger>
+														{/* Edit department window */}
 														<AlertDialogContent> 
 															<AlertDialogHeader>Edit {department.name}</AlertDialogHeader>
 															<form onSubmit={(e)=>{e.preventDefault();editDepartment(department.name, departmentNameInput,buildDep.building.name);setDepartmentNameInput("")}}>
@@ -602,9 +630,11 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 														</AlertDialogContent>
 													</AlertDialog>
 													<AlertDialog>
+														{/* Delete Department Button */}
 														<AlertDialogTrigger asChild>
 															<Button className="h-[30px] w-[60px]" variant="outline" >Delete</Button>
 														</AlertDialogTrigger>
+														{/* Delete Department Window */}
 														<AlertDialogContent> 
 															<AlertDialogHeader>Are you sure about deleting {department.name}? This will remove it from alle machines that has this department.</AlertDialogHeader>
 															<AlertDialogAction onClick={()=>deleteDepartment(department.name)}>DELETE</AlertDialogAction>
@@ -665,13 +695,11 @@ interface DisplayBuildingDepartmentDataProps extends ManagePopup {
 
 			<Separator className='mx-10' orientation="vertical"/> {/* Needs parent container to be set to 100% height for it to work as it takes on the height of parent container */}
 
-			<div className="w-[400px]">
-
-			</div>
+			<div className="w-[400px]" />
             
 		</div>
 	);
-};
+}
 
 
 
diff --git a/Frontend/power-tracker/src/components/manageGateway.tsx b/Frontend/power-tracker/src/components/manageGateway.tsx
index b01fd0dfa23b2a745d4fb4392c5944bc7e8eb8cf..507751d8b80f7aa74fc0ded4488b5cdae7b21167 100644
--- a/Frontend/power-tracker/src/components/manageGateway.tsx
+++ b/Frontend/power-tracker/src/components/manageGateway.tsx
@@ -7,7 +7,6 @@ import { Input } from "@/components/ui/input"
 import { Separator } from "@/components/ui/separator"
 import { Plus } from 'lucide-react';
 import { Router } from 'lucide-react';
-import { Textarea } from "@/components/ui/textarea"
 import {
     Table,
     TableBody,
@@ -33,6 +32,9 @@ import {
     AlertDialogTitle,
     AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
+import { ToastAction } from "@/components/ui/toast"
+import { useToast } from "@/components/ui/use-toast"
+
 
 const EgressAPI = import.meta.env.VITE_EAPI_URL
 const IngressAPI = import.meta.env.VITE_IAPI_URL
@@ -169,7 +171,7 @@ async function fetchDataGateway(): Promise<Gateway[]> {
     })
     return gateway 
 }
-
+    const { toast } = useToast()
 
     return (
         <ResizablePanelGroup className='flex h-[100%]' direction="horizontal">
@@ -218,7 +220,15 @@ async function fetchDataGateway(): Promise<Gateway[]> {
                             <Input className="mb-[20px]" type="text" value={nameInput} onChange={(event) => setNameInput(event.target.value)} required/>
                             <br/> <br/>
                             <AlertDialogFooter>
-                            <AlertDialogAction type='submit'>Submit gateway!</AlertDialogAction>
+                            <AlertDialogAction 
+                                type='submit'
+                                onClick={ ()=>{
+                                    toast({
+                                        title: "Added Gateway!",
+                                    })
+                                }}>
+                                Submit gateway!
+                            </AlertDialogAction>
                             <AlertDialogCancel>Cancel</AlertDialogCancel>
                         </AlertDialogFooter>
                         </form>
@@ -255,7 +265,11 @@ async function fetchDataGateway(): Promise<Gateway[]> {
                                         <Input className="mb-[20px]" type="text" placeholder="EUI" value={euiInput} onChange={(event) => setEuiInput(event.target.value)} required/>
                                         <label>Name</label>
                                         <Input className="mb-[20px]" type="text" placeholder="Name" value={nameInput} onChange={(event) => setNameInput(event.target.value)} required/>
-                                        <AlertDialogAction type='submit'>Confirm</AlertDialogAction>
+                                        <AlertDialogAction type='submit' onClick={() => { 
+                                            toast({
+                                                title: "Edited Gateway.",
+                                            })
+                                        }}>Confirm</AlertDialogAction>
                                         <AlertDialogCancel onClick={()=>{setEuiInput(""); setNameInput("");}}>Cancel</AlertDialogCancel>
                                         </form>
                                     </AlertDialogContent>
@@ -266,7 +280,14 @@ async function fetchDataGateway(): Promise<Gateway[]> {
                                     </AlertDialogTrigger>
                                     <AlertDialogContent> 
                                         <AlertDialogHeader>Are you sure about deleting {gates.eui_gate} - {gates.name}?</AlertDialogHeader>
-                                        <AlertDialogAction onClick={()=>deleteGateway(gates.eui_gate)}>DELETE</AlertDialogAction>
+                                        <AlertDialogAction 
+                                            onClick={()=>{
+                                                deleteGateway(gates.eui_gate);
+                                                toast({
+                                                    title: "Deleted Gateway.",
+                                                })
+                                            }}>DELETE
+                                        </AlertDialogAction>
                                         <AlertDialogCancel>Cancel</AlertDialogCancel>
                                     </AlertDialogContent>
                                 </AlertDialog>
@@ -288,6 +309,4 @@ async function fetchDataGateway(): Promise<Gateway[]> {
 }
 
 
-
-
 export default ManageGateways
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/components/manageProcesses.tsx b/Frontend/power-tracker/src/components/manageProcesses.tsx
index be50aa363a33d6f9411369cad0568db3a4923c38..72d621ec73cafabe773af4cdd4973fd6fa2a3908 100644
--- a/Frontend/power-tracker/src/components/manageProcesses.tsx
+++ b/Frontend/power-tracker/src/components/manageProcesses.tsx
@@ -18,16 +18,12 @@ import {
   AlertDialogTitle,
   AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
-import {
-	Accordion,
-	AccordionContent,
-	AccordionItem,
-	AccordionTrigger,
-} from "@/components/ui/accordion"
+import { ToastAction } from "@/components/ui/toast"
+import { useToast } from "@/components/ui/use-toast"
 const EgressAPI = import.meta.env.VITE_EAPI_URL
 const IngressAPI = import.meta.env.VITE_IAPI_URL
 
-const ManageProcesses= () => {
+const ManageProcesses = () => {
   // Initialize the state with the defined type
   const [processData, setProcessData] = useState({
     process: [{
@@ -53,6 +49,8 @@ const ManageProcesses= () => {
   const [processDropDown, setProcessDropDown] = useState("");
   const [processDropDownId, setProcessDropDownId] = useState(0);
 
+  const { toast } = useToast()
+
   const [processMachineData, setProcessMachineData] = useState({
     processMachine: [{
       added: false,
@@ -68,7 +66,7 @@ const ManageProcesses= () => {
       machineName: "",
     }]
   });
-    
+
   const handleEdit = (index: number, value: string, value2: string, value3: boolean) => {
     setEditIndex(index);
     setText(value);
@@ -93,13 +91,13 @@ const ManageProcesses= () => {
 
   // Assuming fetchDataProcess is an async function that fetches data
   useEffect(() => {
-      fetchDataProcess().then((data) => {
-        setProcessData({
-          ...processData,
-          process: data.map((prcoesses) => ({id: prcoesses.id, name: prcoesses.name, description: prcoesses.description }))
-        });
+    fetchDataProcess().then((data) => {
+      setProcessData({
+        ...processData,
+        process: data.map((prcoesses) => ({ id: prcoesses.id, name: prcoesses.name, description: prcoesses.description }))
       });
-  },[]);
+    });
+  }, []);
 
   useEffect(() => {
     fetchDataProcessMachine(processDropDownId).then((data) => {
@@ -125,92 +123,92 @@ const ManageProcesses= () => {
   const [open, setOpen] = useState(false);
 
   const handleClose = () => {
-      setOpen(false);
+    setOpen(false);
   };
 
-  
-interface Process {
-  process: {
+
+  interface Process {
+    process: {
       id: number,
       name: string;
       description: string;
-  }[];
-}
-type setProcess = React.Dispatch<React.SetStateAction<{
-  process: {
+    }[];
+  }
+  type setProcess = React.Dispatch<React.SetStateAction<{
+    process: {
       id: number,
       name: string;
       description: string;
-  }[];
-}>>
-interface ProcessDataForFunction {
-  data: Process
-  setData: setProcess
-}
-
-interface ProcessMachine {
-  processMachine: {
-    added: boolean;
-    machineEUI: string;
-    machineName: string;
-  }[];
-}
-interface ProcessMachineInsert {
-  processMachine: {
-    added: boolean;
-    machineEUI: string;
-    processId: number;
-  }[];
-}
-interface typeProcessMachineInsert {
-  
+    }[];
+  }>>
+  interface ProcessDataForFunction {
+    data: Process
+    setData: setProcess
+  }
+
+  interface ProcessMachine {
+    processMachine: {
+      added: boolean;
+      machineEUI: string;
+      machineName: string;
+    }[];
+  }
+  interface ProcessMachineInsert {
+    processMachine: {
+      added: boolean;
+      machineEUI: string;
+      processId: number;
+    }[];
+  }
+  interface typeProcessMachineInsert {
+
     added: boolean;
     eui: string;
     processId: number;
 
-}
-type setProcessMachine = React.Dispatch<React.SetStateAction<{
-  processMachine: {
-    added: boolean;
-    machineEUI: string;
-    machineName: string;
-  }[];
-}>>
-interface ProcessMachineDataForFunction {
-  data: ProcessMachine
-  setData: setProcessMachine
-  setData2: setProcessMachine
-  processId: number
-}
-interface ProcessMachineDataForFunction2 {
-  data: ProcessMachine
-  data2: ProcessMachine
-  processId: number
-}
-
-const addProcess = (e: React.FormEvent<HTMLFormElement>, name: string, description: string) =>  {
-  e.preventDefault()
-  var token: string = ""
-  var tokenBool = sessionStorage.getItem("TOKEN")
-  if (tokenBool == null) {
+  }
+  type setProcessMachine = React.Dispatch<React.SetStateAction<{
+    processMachine: {
+      added: boolean;
+      machineEUI: string;
+      machineName: string;
+    }[];
+  }>>
+  interface ProcessMachineDataForFunction {
+    data: ProcessMachine
+    setData: setProcessMachine
+    setData2: setProcessMachine
+    processId: number
+  }
+  interface ProcessMachineDataForFunction2 {
+    data: ProcessMachine
+    data2: ProcessMachine
+    processId: number
+  }
+
+  const addProcess = (e: React.FormEvent<HTMLFormElement>, name: string, description: string) => {
+    e.preventDefault()
+    var token: string = ""
+    var tokenBool = sessionStorage.getItem("TOKEN")
+    if (tokenBool == null) {
       redirect('/')
-  } else {
+    } else {
       token = tokenBool
-  }
-  axios.post(
-    IngressAPI + '/new-process',
-    {                
-      process_name: name,
-      description: description,
-      sessionToken:token
     }
-  ).then((res)=>{
-    console.log(res.data)
-  }).catch((error) => {
-    console.log(error)
-    setOpen(true)
-  })
-}
+    axios.post(
+      IngressAPI + '/new-process',
+      {
+        process_name: name,
+        description: description,
+        sessionToken: token
+      }
+    ).then((res) => {
+      console.log(res.data)
+    }).catch((error) => {
+      console.log(error)
+      setOpen(true)
+    })
+  }
 
   const handleSave2 = (data1: any, data2: any, processId: any) => {
     ProcessDataInsertion({ data: data1, data2: data2, processId: processId });
@@ -220,216 +218,218 @@ const addProcess = (e: React.FormEvent<HTMLFormElement>, name: string, descripti
     data2: processMachineData2,
     processId,
   }) => {
-  var realArray: ProcessMachineInsert[] = [];
-  var oldArray: ProcessMachineInsert[] = [];
-
-  processMachineData.processMachine.forEach((item) => {
-    realArray.push({
-      processMachine: [{
-        added: item.added,
-        machineEUI: item.machineEUI,
-        processId: processId
-      }]
+    var realArray: ProcessMachineInsert[] = [];
+    var oldArray: ProcessMachineInsert[] = [];
+
+    processMachineData.processMachine.forEach((item) => {
+      realArray.push({
+        processMachine: [{
+          added: item.added,
+          machineEUI: item.machineEUI,
+          processId: processId
+        }]
+      });
     });
-  });
 
-  processMachineData2.processMachine.forEach((item) => {
-    oldArray.push({
-      processMachine: [{
-        added: item.added,
-        machineEUI: item.machineEUI,
-        processId: processId
-      }]
+    processMachineData2.processMachine.forEach((item) => {
+      oldArray.push({
+        processMachine: [{
+          added: item.added,
+          machineEUI: item.machineEUI,
+          processId: processId
+        }]
+      });
     });
-  });
 
-  editProcessMachine(realArray, oldArray)
-  return null
-};
+    editProcessMachine(realArray, oldArray)
+    return null
+  };
 
-const editProcessMachine = ( realData:  ProcessMachineInsert[], oldData: ProcessMachineInsert[]) =>  {
-  var token: string = ""
-  var tokenBool = sessionStorage.getItem("TOKEN")
-  if (tokenBool == null) {
-    redirect('/')
-  } else {
-    token = tokenBool
-  }
-  const requestData: typeProcessMachineInsert[] = [];
-  realData.forEach((item, index) => {
-    if (oldData[index].processMachine) {
-      item.processMachine.forEach((item2, index2) => {
-        if ( oldData[index].processMachine[index2].added !== item2.added) {
-          requestData.push({
-            added: item2.added,
-            processId: item2.processId,
-            eui: item2.machineEUI
-          });
-        }
-      });
+  const editProcessMachine = (realData: ProcessMachineInsert[], oldData: ProcessMachineInsert[]) => {
+    var token: string = ""
+    var tokenBool = sessionStorage.getItem("TOKEN")
+    if (tokenBool == null) {
+      redirect('/')
+    } else {
+      token = tokenBool
     }
-  });
-  axios.put(
+    const requestData: typeProcessMachineInsert[] = [];
+    realData.forEach((item, index) => {
+      if (oldData[index].processMachine) {
+        item.processMachine.forEach((item2, index2) => {
+          if (oldData[index].processMachine[index2].added !== item2.added) {
+            requestData.push({
+              added: item2.added,
+              processId: item2.processId,
+              eui: item2.machineEUI
+            });
+          }
+        });
+      }
+    });
+    axios.put(
       IngressAPI + '/machineProcess',
-      {                
-          data: requestData,
-          sessionToken:token,
+      {
+        data: requestData,
+        sessionToken: token,
       }
-  ).then((res)=>{
-    console.log(res.data)
-  }).catch((error) => {
-    console.log(error)
-    setOpen(true)
-  })
-}
-
-const editProcess = ( oldName: string, newName: string, oldDescription: string, newDescription: string) =>  {
-  var token: string = ""
-  var tokenBool = sessionStorage.getItem("TOKEN")
-  if (tokenBool == null) {
-    redirect('/')
-  } else {
-    token = tokenBool
+    ).then((res) => {
+      console.log(res.data)
+    }).catch((error) => {
+      console.log(error)
+      setOpen(true)
+    })
   }
-  axios.put(
-    IngressAPI + '/new-process',
-      {                
-        old_process_name : oldName,
-        new_process_name : newName,
-        old_description : oldDescription,
-        new_description : newDescription,
+
+  const editProcess = (oldName: string, newName: string, oldDescription: string, newDescription: string) => {
+    var token: string = ""
+    var tokenBool = sessionStorage.getItem("TOKEN")
+    if (tokenBool == null) {
+      redirect('/')
+    } else {
+      token = tokenBool
+    }
+    axios.put(
+      IngressAPI + '/new-process',
+      {
+        old_process_name: oldName,
+        new_process_name: newName,
+        old_description: oldDescription,
+        new_description: newDescription,
         sessionToken: token
       }
-  ).then((res)=>{
-    console.log(res.data)
-  }).catch((error) => {
-    console.log(error)
-    setOpen(true)
-  })
-}
-const deleteProcess = (name: string, description:string) =>  {
-
-
-  var token: string = ""
-  var tokenBool = sessionStorage.getItem("TOKEN")
-  if (tokenBool == null) {
-    redirect('/')
-  } else {
-    token = tokenBool
+    ).then((res) => {
+      console.log(res.data)
+    }).catch((error) => {
+      console.log(error)
+      setOpen(true)
+    })
   }
-  axios.delete(
-    IngressAPI + '/new-process',
-      {   
-        data:{
+  const deleteProcess = (name: string, description: string) => {
+
+
+    var token: string = ""
+    var tokenBool = sessionStorage.getItem("TOKEN")
+    if (tokenBool == null) {
+      redirect('/')
+    } else {
+      token = tokenBool
+    }
+    axios.delete(
+      IngressAPI + '/new-process',
+      {
+        data: {
           process_name: name,
           description: description,
           sessionToken: token
-          }
+        }
       }
-  ).then((res)=>{
-    console.log(res.data)
-  }).catch((error) => {
-    console.log(error)
-    setOpen(true)
-  })
-}
-
-
-class Processes {
-  id: number = 0;
-  name: string = "";
-  description: string = "";
-  constructor(id: number, name: string, description: string) {
-    this.id = id, this.name = name; this.description = description;
+    ).then((res) => {
+      console.log(res.data)
+    }).catch((error) => {
+      console.log(error)
+      setOpen(true)
+    })
   }
-}
-
-async function fetchDataProcess(): Promise<Processes[]> {
-  var processArrray: Processes[] = []
-  await axios.post(EgressAPI + '/process',
-  {
-    sessionToken: sessionStorage.getItem('TOKEN')
-  }).then((res) => {  
-    res.data.process.forEach((element: any) => {
-      processArrray.push({
-        id: element.id,
-        name: element.name,
-        description: element.description
-      })
-    });
-  }).catch((error) => {
-    console.log(error)
-    setOpen(true)
-  })
-  return processArrray 
-}
-
-class ProcessesMachine {
-  added: boolean = false;
-  machineEUI: string = "";
-  machineName: string = "";
-  constructor(added: boolean, machineEUI: string, machineName: string) {
-    this.added = added, this.machineEUI = machineEUI; this.machineName = machineName;
+
+
+  class Processes {
+    id: number = 0;
+    name: string = "";
+    description: string = "";
+    constructor(id: number, name: string, description: string) {
+      this.id = id, this.name = name; this.description = description;
+    }
   }
-}
-
-async function fetchDataProcessMachine(processId: number): Promise<ProcessesMachine[]> {
-  const processArray: ProcessesMachine[] = [];
-  try {
-    const res = await axios.post(EgressAPI + '/processMachine', {
-      process: processId,
-      sessionToken: sessionStorage.getItem('TOKEN')
-    });
-    const { added, machines } = res.data;
-    // Iterate over the added array
-    added.forEach((add: boolean, index: number) => {
-      // Check if machines[index] exists
-      if (machines[index]) {
-        processArray.push({
-          added: add,
-          machineEUI: machines[index].eui,
-          machineName: machines[index].name,
+
+  async function fetchDataProcess(): Promise<Processes[]> {
+    var processArrray: Processes[] = []
+    await axios.post(EgressAPI + '/process',
+      {
+        sessionToken: sessionStorage.getItem('TOKEN')
+      }).then((res) => {
+        res.data.process.forEach((element: any) => {
+          processArrray.push({
+            id: element.id,
+            name: element.name,
+            description: element.description
+          })
         });
-      }
-    });
-    return processArray;
-  } catch (error) {
-    console.log(error);
-    return [];
+      }).catch((error) => {
+        console.log(error)
+        setOpen(true)
+      })
+    return processArrray
+  }
+
+  class ProcessesMachine {
+    added: boolean = false;
+    machineEUI: string = "";
+    machineName: string = "";
+    constructor(added: boolean, machineEUI: string, machineName: string) {
+      this.added = added, this.machineEUI = machineEUI; this.machineName = machineName;
+    }
+  }
+
+  async function fetchDataProcessMachine(processId: number): Promise<ProcessesMachine[]> {
+    const processArray: ProcessesMachine[] = [];
+    try {
+      const res = await axios.post(EgressAPI + '/processMachine', {
+        process: processId,
+        sessionToken: sessionStorage.getItem('TOKEN')
+      });
+      const { added, machines } = res.data;
+      // Iterate over the added array
+      added.forEach((add: boolean, index: number) => {
+        // Check if machines[index] exists
+        if (machines[index]) {
+          processArray.push({
+            added: add,
+            machineEUI: machines[index].eui,
+            machineName: machines[index].name,
+          });
+        }
+      });
+      return processArray;
+    } catch (error) {
+      console.log(error);
+      return [];
+    }
   }
-}
 
   return (
     <div className="flex h-[100%]">
+
       <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+        <AlertDialogContent>
+          <AlertDialogHeader>
+            <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+          </AlertDialogHeader>
+          <div>
+            Please try again or check your connection
+          </div>
+          <AlertDialogFooter>
+            <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+          </AlertDialogFooter>
+        </AlertDialogContent>
+      </AlertDialog>
       <div className='w-[1100px]'>
+
         {/* Title and search bar */}
         <div className="w-[100%] h-[40px] flex justify-between content-center" style={{ marginTop: '5px' }}>
-					<h1 className="scroll-m-20 text-2xl font-semibold tracking-tight">Processes</h1>
-					<Input 
-						className="h-[30px] w-[200px]" 
-						type="text" 
-						value={search} 
-						onChange={(event) => setSearch(event.target.value) } 
-						placeholder="Search.."
-					/>
-				</div>
-
-        <Separator className="mb-[10px]" />	
-
-        {/* New process button */}
+          <h1 className="scroll-m-20 text-2xl font-semibold tracking-tight">Processes</h1>
+          <Input
+            className="h-[30px] w-[200px]"
+            type="text"
+            value={search}
+            onChange={(event) => setSearch(event.target.value)}
+            placeholder="Search.."
+          />
+        </div>
+
+        <Separator className="mb-[10px]" />
+
+        {/* New process button and window*/}
 				<AlertDialog>
 					<AlertDialogTrigger> 
 						<Button className="w-[60px] h-[30px] mb-[10px] ml-[10px]" variant="default" size="icon" >
@@ -456,16 +456,20 @@ async function fetchDataProcessMachine(processId: number): Promise<ProcessesMach
                         }
                       ]
                     }));
+                    toast({
+											title: "Added Process.",
+										})
                   }}>Submit Process!</Button>
                 </AlertDialogAction>
                 <AlertDialogCancel>Cancel</AlertDialogCancel>
               </AlertDialogFooter>
             </form>
-					</AlertDialogContent>
-				</AlertDialog>	
+          </AlertDialogContent>
+        </AlertDialog>
 
-        <Separator />	
+        <Separator />
 
+        {/* List of Processes */}
         <ul>
           {processData.process.map((process, index) => (
             <li>
@@ -477,59 +481,78 @@ async function fetchDataProcessMachine(processId: number): Promise<ProcessesMach
                 </div> 
                 <Separator orientation='vertical' className="mx-[5px]"/>
                 <div className="h-[100%] flex items-center justify-around">
-                <AlertDialog>
-                  <AlertDialogTrigger asChild>
-                    <Button className="h-[30px] w-[60px]" variant="outline" onClick={()=>{setText(process.name); setDesc(process.description)}}>Edit</Button>
-                  </AlertDialogTrigger>
-                  <AlertDialogContent> 
-                    <AlertDialogHeader>Edit {process.name}</AlertDialogHeader>
-                    <form onSubmit={(e)=>{e.preventDefault();editProcess(process.name, text ,process.description,desc); setText(""); setDesc("");}}>
-                      <label>Process Name</label>
-                      <Input className="mb-[20px]" type="text" placeholder="Process Name" value={text} onChange={(event) => setText(event.target.value)} required/>
-                      <label>Description</label>
-                      <Input className="mb-[20px]" type="text" placeholder="Description" value={desc} onChange={(event) => setDesc(event.target.value)} required/>
-                      <AlertDialogAction type='submit'>Confirm</AlertDialogAction>
-                      <AlertDialogCancel onClick={()=>{setText(""); setDesc("");}}>Cancel</AlertDialogCancel>
-                    </form>
-                  </AlertDialogContent>
-                </AlertDialog>
-                <AlertDialog>
-                  <AlertDialogTrigger asChild>
-                    <Button className="h-[30px] w-[60px]" variant="outline" >Delete</Button>
-                  </AlertDialogTrigger>
-                  <AlertDialogContent> 
-                    <AlertDialogHeader>Are you sure about deleting {process.name}?</AlertDialogHeader>
-                    <AlertDialogAction onClick={()=>deleteProcess(process.name, process.description)}>DELETE</AlertDialogAction>
-                    <AlertDialogCancel>Cancel</AlertDialogCancel>
-                  </AlertDialogContent>
-                </AlertDialog>
+                  {/* Edit Process Button and window */}
+                  <AlertDialog>
+                    {/* Edit Button */}
+                    <AlertDialogTrigger asChild>
+                      <Button className="h-[30px] w-[60px]" variant="outline" onClick={()=>{setText(process.name); setDesc(process.description)}}>Edit</Button>
+                    </AlertDialogTrigger>
+                    <AlertDialogContent> 
+                      <AlertDialogHeader>Edit {process.name}</AlertDialogHeader>
+                      <form onSubmit={(e)=>{e.preventDefault();editProcess(process.name, text ,process.description,desc); setText(""); setDesc("");}}>
+                        <label>Process Name</label>
+                        <Input className="mb-[20px]" type="text" placeholder="Process Name" value={text} onChange={(event) => setText(event.target.value)} required/>
+                        <label>Description</label>
+                        <Input className="mb-[20px]" type="text" placeholder="Description" value={desc} onChange={(event) => setDesc(event.target.value)} required/>
+                        <AlertDialogAction type='submit' onClick={ ()=>{
+                          toast({
+                            title: "Edited Process.",
+                          })
+                        }}>Confirm</AlertDialogAction>
+                        <AlertDialogCancel onClick={()=>{setText(""); setDesc("");}}>Cancel</AlertDialogCancel>
+                      </form>
+                    </AlertDialogContent>
+                  </AlertDialog>
+
+                  {/* Delete Process Button */}
+                  <AlertDialog>
+                    <AlertDialogTrigger asChild>
+                      <Button className="h-[30px] w-[60px]" variant="outline" >Delete</Button>
+                    </AlertDialogTrigger>
+                    <AlertDialogContent> 
+                      <AlertDialogHeader>Are you sure about deleting {process.name}?</AlertDialogHeader>
+                      <AlertDialogAction onClick={()=>{
+                        deleteProcess(process.name, process.description);
+                        toast({
+                          title: "Deleted Process.",
+                        })}}>DELETE</AlertDialogAction>
+                      <AlertDialogCancel>Cancel</AlertDialogCancel>
+                    </AlertDialogContent>
+                  </AlertDialog>
+
                 </div>
+
                 <Separator orientation='vertical' className="ml-[5px]"/>
+
               </div>
-              <Separator />	
+              <Separator />
             </li>
           ))}
         </ul>
 
         <div className="center">
+
+          {/* Add machines to Process button and window */}
           <AlertDialog>
+            {/* Add Button */}
             <AlertDialogTrigger asChild>
-              <Button size="sm" variant="outline" onClick={()=>{}}>Add machine to process</Button>
+              <Button size="sm" variant="outline" onClick={() => { }}>Add machine to process</Button>
             </AlertDialogTrigger>
             <AlertDialogContent>
               <AlertDialogHeader>
                 <AlertDialogTitle>Add machine to process</AlertDialogTitle>
                 <label>Process</label>
-                <select onChange={(e) => { const selectedIndex = e.target.selectedIndex; setProcessDropDown(e.target.value); setProcessDropDownId(processData.process[selectedIndex-1].id)}} value={processDropDown}>
+                <select onChange={(e) => { const selectedIndex = e.target.selectedIndex; setProcessDropDown(e.target.value); setProcessDropDownId(processData.process[selectedIndex - 1].id) }} value={processDropDown}>
                   <option value={""}>Select an option</option>
                   {processData.process.map((pro, index) => (
                     pro.name !== "" ? (
                       <option key={index} value={pro.name}>
-                        {pro.name} 
+                        {pro.name}
                       </option>
                     ) : null
                   ))}
                 </select>
+                {/* List of machines */}
                 {processDropDown !== "" && (
                   <div>
                     {processMachineData.processMachine.map((element, index) => (
@@ -547,24 +570,31 @@ async function fetchDataProcessMachine(processId: number): Promise<ProcessesMach
                           }}
                         />
                         {element.machineEUI}  {element.machineName}
-                        <br/>
+                        <br />
                       </div>
                     ))}
                   </div>
                 )}
               </AlertDialogHeader>
+              {/* Submit/Cancel Action */}
               <AlertDialogFooter>
-                <AlertDialogAction type='submit' onClick={()=>{handleSave2(processMachineData, processMachineData2, processDropDownId); console.log(processDropDownId)}}>Save</AlertDialogAction>
+                <AlertDialogAction type='submit' onClick={()=>{
+                  handleSave2(processMachineData, processMachineData2, processDropDownId); 
+                  console.log(processDropDownId);
+                  toast({
+                    title: "Added selected machine(s) to process.",
+                  })}}>Save</AlertDialogAction>
                 <AlertDialogCancel>Cancel</AlertDialogCancel>
               </AlertDialogFooter>
             </AlertDialogContent>
           </AlertDialog>
+
         </div>
       </div>
       <Separator className='mx-10' orientation="vertical"/> {/* Needs parent container to be set to 100% height for it to work as it takes on the height of parent container */}
       <div className="w-[400px]">
 
-			</div>
+      </div>
     </div>
   );
 };
diff --git a/Frontend/power-tracker/src/components/topbar.tsx b/Frontend/power-tracker/src/components/topbar.tsx
index ca2ecc482eb0a961b8afb0294be55fe74f8f950d..51f878371ebe35b9b569432c2ea8e6626778a99c 100644
--- a/Frontend/power-tracker/src/components/topbar.tsx
+++ b/Frontend/power-tracker/src/components/topbar.tsx
@@ -21,22 +21,19 @@ import {
 function TopBar() {
 
     const navigate =  useNavigate();
-    const [isOpen, setIsOpen] = useState(false)
-
-    function toggle() {
-        setIsOpen((isOpen) => !isOpen);
-    }
 
+    // User logs out
     const logout = async () => {
         sessionStorage.removeItem("TOKEN");
         return navigate('/');
     };
 
+    // Retrieves users first and last name
     var Name = sessionStorage.getItem("FIRSTNAME")+ " " + sessionStorage.getItem("LASTNAME")
 
     return (
         <div id="menubar">
-            {/*-------------- MAIN BAR --------------*/}
+            {/*-------------- Top MAIN BAR --------------*/}
             <div id="topbar">
                 <div id = "topbar-start">
                     <p className = "elem">{Name}</p>
@@ -48,7 +45,7 @@ function TopBar() {
                 </div>
             </div>
             <Separator/>
-            {/*-------------- NAVIGATION --------------*/}
+            {/*-------------- Bottom NAVIGATION --------------*/}
             <div>
                 <div className='navbar'>
                     <NavigationMenu>
@@ -66,7 +63,7 @@ function TopBar() {
                             {sessionStorage.getItem("PERMISSION") === "0" && (
                             <NavigationMenuItem>
                                 <NavigationMenuLink className={navigationMenuTriggerStyle()} asChild>
-                                    <Link to="/sensors">Sensor Management</Link>
+                                    <Link to="/sensors">Machine Management</Link>
                                 </NavigationMenuLink>
                             </NavigationMenuItem>
                             )}
diff --git a/Frontend/power-tracker/src/pages/ManageSensors.tsx b/Frontend/power-tracker/src/pages/ManageSensors.tsx
index a51833fdd9fcc6981c8fee3bdab00fd8219c8805..cd8967f546d5589e44afe33f8b46bca171c51d32 100644
--- a/Frontend/power-tracker/src/pages/ManageSensors.tsx
+++ b/Frontend/power-tracker/src/pages/ManageSensors.tsx
@@ -13,14 +13,6 @@ import {
     SelectTrigger,
     SelectValue,
 } from "@/components/ui/select"
-import {
-    Card,
-    CardContent,
-    CardDescription,
-    CardFooter,
-    CardHeader,
-    CardTitle,
-} from "@/components/ui/card"
 import {
     Table,
     TableBody,
@@ -54,10 +46,9 @@ import {
 import { ScrollArea } from "@/components/ui/scroll-area"
 import { z } from "zod"
 import { useForm } from "react-hook-form"
-import { zodResolver } from "@hookform/resolvers/zod"
 import { PlusIcon } from 'lucide-react';
 import { Input } from "@/components/ui/input"
-import { machine } from 'os';
+import { useToast } from "@/components/ui/use-toast"
 
 const EgressAPI = import.meta.env.VITE_EAPI_URL
 const IngressAPI = import.meta.env.VITE_IAPI_URL
@@ -67,6 +58,7 @@ function ManageSensors() {
 
     //
     const buttonRef = useRef(null);
+    const { toast } = useToast()
 
     const [sensorData, setSensorData] = useState({
         sensor: [{
@@ -387,28 +379,37 @@ function ManageSensors() {
     return(
         <>
         <TopBar></TopBar>
+
         <main>
-        <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+            {/* Page load error */}3
+            <AlertDialog open={open}>
+                <AlertDialogContent>
+                    <AlertDialogHeader>
+                        <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+                    </AlertDialogHeader>
+                    <div>
+                        Please try again or check your connection
+                    </div>
+                    <AlertDialogFooter>
+                        <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+                    </AlertDialogFooter>
+                </AlertDialogContent>
+            </AlertDialog>
+
             <div className='leftbar'>
                 <div className='w-[100%] rounded-md border shadow-md pl-[10px] flex items-center justify-between'>
-                    <p>Add Sensor</p>
+
+                    {/* Add machine Button and window */}
+                    <p>Add Machine</p>
                     <AlertDialog>
-                        <AlertDialogTrigger><Button variant="outline" size="icon"><PlusIcon className='w-[20px]'></PlusIcon></Button></AlertDialogTrigger>
+                        {/* Add machine Button */}
+                        <AlertDialogTrigger>
+                            <Button variant="outline" size="icon"><PlusIcon className='w-[20px]'></PlusIcon></Button>
+                        </AlertDialogTrigger>
+                        {/* Add machine window */}
                         <AlertDialogContent>
                             <AlertDialogHeader>
-                                <AlertDialogTitle>Add Sensor</AlertDialogTitle>
+                                <AlertDialogTitle>Add Machine</AlertDialogTitle>
                             </AlertDialogHeader>
 
                             <Form {...form}>
@@ -541,18 +542,25 @@ function ManageSensors() {
                                         )}
                                     /> <br/>
                                     <AlertDialogFooter>
-                                        <AlertDialogAction type='submit'>Done</AlertDialogAction>
-                                        <AlertDialogCancel onClick={()=>{form.reset()}}>Cancel</AlertDialogCancel>
+                                        <AlertDialogAction type='submit' onClick={()=>{
+                                            toast({
+                                                title: "Added Machine."
+                                            })
+                                        }
+                                        }>Done</AlertDialogAction>
+                                        <AlertDialogCancel onClick={()=>form.reset()}>
+                                            Cancel
+                                        </AlertDialogCancel>
                                     </AlertDialogFooter>
                                 </form>
                             </Form>
 
-                            
                             </AlertDialogContent>
                     </AlertDialog>
                 </div>
                 <div className = "spacer" />
             </div>
+
             <div className="rightbar">
                 <div className="w-[250px] h-[70px]">
                     <Input type="text" className="outlined-input" value={search} onChange={(event) => setSearch(event.target.value) } placeholder="Search.."/>
@@ -692,7 +700,7 @@ function ManageSensors() {
                                     <Button size="sm" variant="outline">Edit</Button>
                                 </AlertDialogTrigger>
                                     <AlertDialogContent>
-                                        <AlertDialogTitle>Edit Sensor</AlertDialogTitle>
+                                        <AlertDialogTitle>Edit Machine</AlertDialogTitle>
                                             <Form {...form}>
                                                 <form onSubmit={ form.handleSubmit(editSensor)}>
                                                     <FormField
@@ -818,6 +826,9 @@ function ManageSensors() {
                                                     /> <br/>
                                                     <AlertDialogFooter>
                                                         <AlertDialogAction type='submit' onClick={()=>{
+                                                                toast({
+                                                                    title: "Edited Machine."
+                                                                })
                                                                 if (form.getValues().eui === undefined) {
                                                                     form.setValue("eui", machine.eui);
                                                                 }
@@ -851,9 +862,14 @@ function ManageSensors() {
                                     <Button size="sm" variant="outline">Delete</Button>
                                 </AlertDialogTrigger>
                                     <AlertDialogContent>
-                                        <AlertDialogTitle>Delete Sensor?</AlertDialogTitle>
+                                        <AlertDialogTitle>Delete Machine?</AlertDialogTitle>
                                         <AlertDialogDescription>Do you want to delete {machine.eui} - {machine.machine_name} ?</AlertDialogDescription>
-                                        <AlertDialogAction onClick={() => {deleteSensor(machine.eui); }}>DELETE</AlertDialogAction>
+                                        <AlertDialogAction onClick={() => {
+                                            deleteSensor(machine.eui);
+                                            toast({
+                                                title: "Deleted Machine"
+                                            }) 
+                                        }}>DELETE</AlertDialogAction>
                                         <AlertDialogCancel onClick={()=>{form.reset()}}>Cancel</AlertDialogCancel>
                                     </AlertDialogContent>
                                 </AlertDialog>
diff --git a/Frontend/power-tracker/src/pages/adminUserConfig.tsx b/Frontend/power-tracker/src/pages/adminUserConfig.tsx
index 374a5ded056127853d537298c6dc295a1ef05bb9..0e24d68345e45f2961f9ceceddf2d6f94a1d4c51 100644
--- a/Frontend/power-tracker/src/pages/adminUserConfig.tsx
+++ b/Frontend/power-tracker/src/pages/adminUserConfig.tsx
@@ -6,13 +6,6 @@ import { redirect } from 'react-router-dom';
 import "./adminUserConfig.css"
 import axios from 'axios';
 import TopBar from '@/components/topbar';
-import {
-  Select,
-  SelectContent,
-  SelectItem,
-  SelectTrigger,
-  SelectValue,
-} from "@/components/ui/select"
 import {
   Table,
   TableBody,
@@ -47,9 +40,9 @@ import { Input } from '@/components/ui/input';
 import { ScrollArea } from "@/components/ui/scroll-area"
 import { z } from "zod"
 import { useForm } from "react-hook-form"
-import { zodResolver } from "@hookform/resolvers/zod"
-import { Scroll } from 'lucide-react';
 import { PlusIcon } from 'lucide-react';
+import { ToastAction } from "@/components/ui/toast"
+import { useToast } from "@/components/ui/use-toast"
 
 
 const EgressAPI = import.meta.env.VITE_EAPI_URL
@@ -75,7 +68,7 @@ function UserConfig() {
   const [userData, setUserData] = useState<UserData>({ Users: [] });
   const [search, setSearch] = useState("");
   const [usersToShow, setUsersToShow] = useState<UserData>({ Users: [] });
-
+  const { toast } = useToast()
 
 
   var baseAmount = 10
@@ -336,30 +329,33 @@ interface ManageUsersProps {
     }[];
   }
 }
-    
   // --------------------
   return (
     <>
       <TopBar></TopBar>
       <main>
-      <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
-        <div className ="leftbar">
-        <div className='w-[100%] rounded-md border shadow-md pl-[10px] flex items-center justify-between'>
+        <AlertDialog open={open}>
+              <AlertDialogContent>
+              <AlertDialogHeader>
+                  <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+              </AlertDialogHeader>
+                  <div>
+                      Please try again or check your connection
+                  </div>
+              <AlertDialogFooter>
+                  <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+              </AlertDialogFooter>
+              </AlertDialogContent>
+          </AlertDialog>
+          <div className ="leftbar">
+            <div className='w-[100%] rounded-md border shadow-md pl-[10px] flex items-center justify-between'>
                     <p>Add User</p>
                     <AlertDialog>
-                        <AlertDialogTrigger><Button variant="outline" size="icon"><PlusIcon className='w-[20px]'></PlusIcon></Button></AlertDialogTrigger>
+                        {/* Add User button */}
+                        <AlertDialogTrigger>
+                          <Button variant="outline" size="icon"><PlusIcon className='w-[20px]'></PlusIcon></Button>
+                        </AlertDialogTrigger>
+                        {/* Add user Menu */}
                         <AlertDialogContent>
                             <AlertDialogHeader>
                                 <AlertDialogTitle>Add User</AlertDialogTitle>
@@ -429,7 +425,11 @@ interface ManageUsersProps {
                                     />
                                     <br/>
                                     <AlertDialogFooter>
-                                      <AlertDialogAction type="submit">Submit</AlertDialogAction>
+                                      <AlertDialogAction type="submit" onClick={()=>{
+                                        toast({
+                                          title: "Added User.",
+                                        })
+                                      }}>Submit</AlertDialogAction>
                                       <AlertDialogCancel  onClick={()=>{form.reset()}}>Cancel</AlertDialogCancel>
                                     </AlertDialogFooter>
                                 </form>
@@ -504,127 +504,135 @@ interface ManageUsersProps {
                     <TableCell>{user.LastName}</TableCell>
                     <TableCell>{user.email}</TableCell>
                     <TableCell>{user.permission}</TableCell>
-                    <div className="center">
-                                <AlertDialog>
-                                <AlertDialogTrigger asChild>
-                                    <Button size="sm" variant="outline">Edit</Button>
-                                </AlertDialogTrigger>
-                                    <AlertDialogContent>
-                                        <AlertDialogTitle>Edit Sensor</AlertDialogTitle>
-                                            <Form {...form}>
-                                                <form onSubmit={ form.handleSubmit(onEdit)}>
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='id'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>ID</FormLabel>
-                                                                <FormControl>
-                                                                    <Input readOnly defaultValue={user.id} {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    />
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='firstName'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>First Name</FormLabel>
-                                                                <FormControl>
-                                                                    <Input defaultValue={user.FirstName} {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    />
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='lastName'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>Last Name</FormLabel>
-                                                                <FormControl>
-                                                                    <Input defaultValue={user.LastName} {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    />
-                                                    
-                                                    <br/>
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='email'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>Email</FormLabel>
-                                                                <FormControl>
-                                                                    <Input  defaultValue={user.email} {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    />
-                                                    <br/>
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='password'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>New Password</FormLabel>
-                                                                <FormControl>
-                                                                    <Input type='password' {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    />
-                                                    <br/>
-                                                    <FormField
-                                                        control={form.control}
-                                                        name='permission'
-                                                        render={({ field }) => (
-                                                            <FormItem>
-                                                                <FormLabel>Permission level</FormLabel>
-                                                                <FormControl>
-                                                                    <Input type="number" defaultValue={user.permission} {...field} />
-                                                                </FormControl>
-                                                            </FormItem> 
-                                                        )}
-                                                    /> <br/>
-                                                    <AlertDialogFooter>
-                                                        <AlertDialogAction type='submit' onClick={()=>{
-                                                                if (form.getValues().id === undefined) {
-                                                                    form.setValue("id", user.id);
-                                                                }
-                                                                if (form.getValues().firstName === undefined) {
-                                                                    form.setValue("firstName",  user.FirstName);
-                                                                }
-                                                                if (form.getValues().lastName === undefined) {
-                                                                    form.setValue("lastName", user.LastName);
-                                                                }
-                                                                if (form.getValues().email === undefined) {
-                                                                    form.setValue("email",  user.email);
-                                                                }
-                                                                if (form.getValues().permission === undefined) {
-                                                                    form.setValue("permission",  user.permission);
-                                                                }
-                                                        }}>Done</AlertDialogAction>
-                                                        <AlertDialogCancel onClick={()=>{form.reset}}>Cancel</AlertDialogCancel>
-                                                    </AlertDialogFooter>
-                                                </form>
-                                            </Form>
-                                    </AlertDialogContent>
-                                </AlertDialog>
-                                <AlertDialog>
-                                <AlertDialogTrigger asChild>
-                                    <Button size="sm" variant="outline">Delete</Button>
-                                </AlertDialogTrigger>
-                                    <AlertDialogContent>
-                                        <AlertDialogTitle>Delete Sensor?</AlertDialogTitle>
-                                        <AlertDialogDescription>Do you want to delete {user.FirstName + " " + user.LastName}?</AlertDialogDescription>
-                                        <AlertDialogAction onClick={() => {deleteUser(user.id); }}>DELETE</AlertDialogAction>
-                                        <AlertDialogCancel>Cancel</AlertDialogCancel>
-                                    </AlertDialogContent>
-                                </AlertDialog>
-                            </div>
+                      <div className="center">
+                        <AlertDialog>
+                          <AlertDialogTrigger asChild>
+                              <Button size="sm" variant="outline">Edit</Button>
+                          </AlertDialogTrigger>
+                            <AlertDialogContent>
+                              <AlertDialogTitle>Edit User</AlertDialogTitle>
+                                <Form {...form}>
+                                  <form onSubmit={ form.handleSubmit(onEdit)}>
+                                      <FormField
+                                          control={form.control}
+                                          name='id'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>ID</FormLabel>
+                                                  <FormControl>
+                                                      <Input readOnly defaultValue={user.id} {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      />
+                                      <FormField
+                                          control={form.control}
+                                          name='firstName'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>First Name</FormLabel>
+                                                  <FormControl>
+                                                      <Input defaultValue={user.FirstName} {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      />
+                                      <FormField
+                                          control={form.control}
+                                          name='lastName'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>Last Name</FormLabel>
+                                                  <FormControl>
+                                                      <Input defaultValue={user.LastName} {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      />
+                                      
+                                      <br/>
+                                      <FormField
+                                          control={form.control}
+                                          name='email'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>Email</FormLabel>
+                                                  <FormControl>
+                                                      <Input  defaultValue={user.email} {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      />
+                                      <br/>
+                                      <FormField
+                                          control={form.control}
+                                          name='password'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>New Password</FormLabel>
+                                                  <FormControl>
+                                                      <Input type='password' {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      />
+                                      <br/>
+                                      <FormField
+                                          control={form.control}
+                                          name='permission'
+                                          render={({ field }) => (
+                                              <FormItem>
+                                                  <FormLabel>Permission level</FormLabel>
+                                                  <FormControl>
+                                                      <Input type="number" defaultValue={user.permission} {...field} />
+                                                  </FormControl>
+                                              </FormItem> 
+                                          )}
+                                      /> <br/>
+                                      <AlertDialogFooter>
+                                          <AlertDialogAction type='submit' onClick={()=>{
+                                                  if (form.getValues().id === undefined) {
+                                                      form.setValue("id", user.id);
+                                                  }
+                                                  if (form.getValues().firstName === undefined) {
+                                                      form.setValue("firstName",  user.FirstName);
+                                                  }
+                                                  if (form.getValues().lastName === undefined) {
+                                                      form.setValue("lastName", user.LastName);
+                                                  }
+                                                  if (form.getValues().email === undefined) {
+                                                      form.setValue("email",  user.email);
+                                                  }
+                                                  if (form.getValues().permission === undefined) {
+                                                      form.setValue("permission",  user.permission);
+                                                  }
+                                                  toast({
+                                                    title: "Edited User.",
+                                                  })
+                                          }}>Done</AlertDialogAction>
+                                          <AlertDialogCancel onClick={()=>{form.reset}}>Cancel</AlertDialogCancel>
+                                      </AlertDialogFooter>
+                                  </form>
+                              </Form>
+                          </AlertDialogContent>
+                        </AlertDialog>
+                        <AlertDialog>
+                          <AlertDialogTrigger asChild>
+                              <Button size="sm" variant="outline">Delete</Button>
+                          </AlertDialogTrigger>
+                          <AlertDialogContent>
+                              <AlertDialogTitle>Delete Sensor?</AlertDialogTitle>
+                              <AlertDialogDescription>Do you want to delete {user.FirstName + " " + user.LastName}?</AlertDialogDescription>
+                              <AlertDialogAction onClick={() => {
+                                deleteUser(user.id); 
+                                toast({
+                                  title: "Deleted User.",
+                                })
+                              }}>DELETE</AlertDialogAction>
+                              <AlertDialogCancel>Cancel</AlertDialogCancel>
+                          </AlertDialogContent>
+                        </AlertDialog>
+                      </div>
                   </TableRow>
                 ))}
               </TableBody>
@@ -634,7 +642,7 @@ interface ManageUsersProps {
       </main>
     </>
   );
-};
+}
 
 
 
diff --git a/Frontend/power-tracker/src/pages/enoek.tsx b/Frontend/power-tracker/src/pages/enoek.tsx
index 6a243eec70df824385dc673622371ead8c414b7b..5ff790e565cbfd8b04c770e08cafe1cc8d381669 100644
--- a/Frontend/power-tracker/src/pages/enoek.tsx
+++ b/Frontend/power-tracker/src/pages/enoek.tsx
@@ -26,258 +26,240 @@ import {
   AlertDialogTrigger,
 } from "@/components/ui/alert-dialog"
 
+//Import the ip for egress and ingress API
 const EgressAPI = import.meta.env.VITE_EAPI_URL
 const IngressAPI = import.meta.env.VITE_IAPI_URL
 
-
+//enum for better clearity in later code
 enum Page {
-    overview = 0,
-    add = 1,
-    active = 2,
-    approved = 3,
-    reject = 4,
-    my = 5,
-    judge =6
-  }
+  overview = 0,
+  add = 1,
+  active = 2,
+  approved = 3,
+  reject = 4,
+  my = 5,
+  judge = 6
+}
 
-// GET THE DATA
+// Class for typing for the fetching of data
 class EnoekClass {
-    id: number = 0;
-    header: string = "";
-    description: string = "";
-    author: string = "";
-    start_date: Date | undefined = new Date();
-    end_date: Date | undefined = new Date();
-    active: boolean = false
-    process: string = ""
-    approved: any = null
-    constructor(id: number, header: string, description: string, author: string, start_date: Date | undefined, end_date: Date | undefined, active: boolean, process: string, approved: any) {
-        this.id = id;
-        this.header = header;
-        this.description = description;
-        this.author = author;
-        this.start_date = start_date;
-        this.end_date = end_date;
-        this.active = active;
-        this.process = process;
-        this.approved = approved;
-    }
+  id: number = 0;
+  header: string = "";
+  description: string = "";
+  author: string = "";
+  start_date: Date | undefined = new Date();
+  end_date: Date | undefined = new Date();
+  active: boolean = false
+  process: string = ""
+  approved: any = null
+  constructor(id: number, header: string, description: string, author: string, start_date: Date | undefined, end_date: Date | undefined, active: boolean, process: string, approved: any) {
+    this.id = id;
+    this.header = header;
+    this.description = description;
+    this.author = author;
+    this.start_date = start_date;
+    this.end_date = end_date;
+    this.active = active;
+    this.process = process;
+    this.approved = approved;
   }
-  
+}
 
-const MainComponent= () =>{
-    
-    const [page, setPage] = useState(Page.overview)
-    const [search, setSearch] = useState("");
 
+const MainComponent = () => {
+  //Constant to keep track of which Enoek page the user is on
+  //With deafualt on overview enoek page
+  const [page, setPage] = useState(Page.overview)
 
-    type EnokDataItem = {
-        id: number;
-        header: string;
-        description: string;
-        author: string;
-        start_date: Date | undefined;
-        end_date: Date | undefined;
-        active: boolean;
-        process: string;
-        approved: boolean | null; // Nullable boolean
-      };
-      
-      const [enoekData, setEnoekData] = useState<{ enoek: EnokDataItem[] }>({
-        enoek: [{
-          id: 0,
-          header: "",
-          description: "",
-          author: "",
-          start_date: new Date(),
-          end_date: new Date(),
-          active: false,
-          process: "",
-          approved: null, // Nullable boolean
-        }],
-      });
-      async function fetchData(): Promise<EnoekClass[]> {
-        var enoekData: EnoekClass[] = []
-        await axios.post(EgressAPI + '/enoek',
-        {
-          sessionToken: sessionStorage.getItem('TOKEN')
-        }).then((res) => {  
-    
-          res.data.enoek.forEach((element: any) => {
-             enoekData.push({
-                id : element.id,
-                header : element.header,
-                description : element.description,
-                author : element.author,
-                start_date : element.start_date,
-                end_date : element.stop_date,
-                active : element.active,
-                process : element.process,
-                approved : element.approved,
-                })
-          });
-        }).catch((error) => {
-          console.log(error)
-          setOpen(true)
-        })
-        
-        return enoekData 
-      }
-    
-    
-      const deleteEnoek = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, id: number) =>  {
-        e.preventDefault()
-      
-        var token: string = ""
-        var tokenBool = sessionStorage.getItem("TOKEN")
-        if (tokenBool == null) {
-            redirect('/')
-        } else {
-            token = tokenBool
-        }
-        console.log('URL To call: ' + IngressAPI + 'token used' + token)
-        axios.delete(
-            IngressAPI + '/new-enoek',
-            {   
-              data:{
-                id: id,
-                sessionToken: token
-                }
-            })
-        .then((res)=>{
-            console.log(res.data)
-        }).catch((error) => {
-            console.log(error)
-            setOpen(true)
-        })
-      }
-  
-    useEffect(() => {
+  //search storage to manage to sort the diffrent tables that gets shown with search
+  const [search, setSearch] = useState("");
 
-        fetchData().then((data) => {
-          setEnoekData({
-            ...enoekData,
-            enoek: data.map((enoeks) => ({ id: enoeks.id, header: enoeks.header, description: enoeks.description, author: enoeks.author, start_date: enoeks.start_date, end_date: enoeks.end_date, active: enoeks.active, process: enoeks.process, approved: enoeks.approved }))
-        });
+  //type for an const for sending the fetched data to the diffrent pages
+  type EnokDataItem = {
+    id: number;
+    header: string;
+    description: string;
+    author: string;
+    start_date: Date | undefined;
+    end_date: Date | undefined;
+    active: boolean;
+    process: string;
+    approved: boolean | null; // Nullable boolean
+  };
+  //usestate const to store fetched data
+  const [enoekData, setEnoekData] = useState<{ enoek: EnokDataItem[] }>({
+    enoek: [{
+      id: 0,
+      header: "",
+      description: "",
+      author: "",
+      start_date: new Date(),
+      end_date: new Date(),
+      active: false,
+      process: "",
+      approved: null, // Nullable boolean
+    }],
+  });
+  //fetching function to get the data from EgressAPI
+  async function fetchData(): Promise<EnoekClass[]> {
+    var enoekData: EnoekClass[] = []
+    await axios.post(EgressAPI + '/enoek',
+      {
+        sessionToken: sessionStorage.getItem('TOKEN')
+      }).then((res) => {
+
+        res.data.enoek.forEach((element: any) => {
+          enoekData.push({
+            id: element.id,
+            header: element.header,
+            description: element.description,
+            author: element.author,
+            start_date: element.start_date,
+            end_date: element.stop_date,
+            active: element.active,
+            process: element.process,
+            approved: element.approved,
+          })
         });
-    }, []);
+      }).catch((error) => {
+        console.log(error)
+        setErrorOpen(true) //If error accures set this to true to make an error message appear
+      })
 
-    let permissionString = sessionStorage.getItem("PERMISSION");
-    let permissionInt 
-if (permissionString !== null) {
+    return enoekData
+  }
+
+  //uses the fetch function and stores the data
+  useEffect(() => {
+    fetchData().then((data) => {
+      setEnoekData({
+        ...enoekData,
+        enoek: data.map((enoeks) => ({ id: enoeks.id, header: enoeks.header, description: enoeks.description, author: enoeks.author, start_date: enoeks.start_date, end_date: enoeks.end_date, active: enoeks.active, process: enoeks.process, approved: enoeks.approved }))
+      });
+    });
+  }, []);
+  //Gets the premission level of the user
+  let permissionString = sessionStorage.getItem("PERMISSION");
+  let permissionInt
+  if (permissionString !== null) {
     // Result is not null, it's safe to assign it to a variable
-     permissionInt = parseInt(permissionString, 10);
-}
-const [open, setOpen] = useState(false);
+    permissionInt = parseInt(permissionString, 10);
+  }
+  //usestate to show the error popup or not
+  const [errorOpen, setErrorOpen] = useState(false);
+  //const to close the error popup
+  const handleClose = () => {
+    setErrorOpen(false);
+  };
 
-    const handleClose = () => {
-        setOpen(false);
-    };
+  return (
+    <>
 
-    return (
-        <>
-          
-            <TopBar></TopBar>
-            <main>
-            <AlertDialog open={open}>
-            <AlertDialogContent>
+      <TopBar></TopBar>
+      <main>
+        {/*Error popup */}
+        {/*---------------*/}
+        <AlertDialog open={errorOpen}>
+          <AlertDialogContent>
             <AlertDialogHeader>
-                <AlertDialogTitle>Something went wrong</AlertDialogTitle>
+              <AlertDialogTitle>Something went wrong</AlertDialogTitle>
             </AlertDialogHeader>
-                <div>
-                    Please try again or check your connection
-                </div>
+            <div>
+              Please try again or check your connection
+            </div>
             <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+              <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
             </AlertDialogFooter>
-            </AlertDialogContent>
+          </AlertDialogContent>
         </AlertDialog>
-              <div className='leftbar'>
-                
-              {permissionInt!= undefined && permissionInt <= 2 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.overview); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">All Measures</h4></Button>
-                    <br></br>
-                    </>
-                    
-                  )}
-                  
-                  {permissionInt!= undefined && permissionInt <= 2 && (
-                    <>
-                 <  Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.add); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Add Enoek</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                  {permissionInt!= undefined && permissionInt <= 2 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.active); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Active Measures</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                  {permissionInt!= undefined && permissionInt <= 1 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.approved); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Approved Measures</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                  {permissionInt!= undefined && permissionInt <= 1 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.reject); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Rejected Measures</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                  {permissionInt!= undefined && permissionInt <= 2 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.my); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">My measures</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                  {permissionInt!= undefined && permissionInt <= 1 && (
-                    <>
-                    <Button className="mb-[10px]" variant="ghost" onClick={()=>{setPage(Page.judge); setSearch("");}}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Accept/reject measures</h4></Button>
-                    <br/>
-                    </>
-                    
-                  )}
-                </div>
-              
-              <div className="rightbar">
-                <div className="w-[250px] h-[70px]">
-                    <Input type="text" className="outlined-input" value={search} onChange={(event) => setSearch(event.target.value) } placeholder="Search.."/>
-                </div>
-            {(() => {
-              switch (page) {
-                case Page.overview:
-                  return <AllMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></AllMeasures>;
-                case Page.add:
-                  return <ManageAdding enoek={enoekData.enoek} setData={setEnoekData} search={search}></ManageAdding>;
-                case Page.active:
-                  return <ActiveMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></ActiveMeasures>;
-                case Page.approved:
-                  return <Approved enoek={enoekData.enoek} setData={setEnoekData} search={search}></Approved>;
-                case Page.reject:
-                  return <Rejected enoek={enoekData.enoek} setData={setEnoekData} search={search}></Rejected>;
-                case Page.my:
-                  return <MyMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></MyMeasures>;
-                case Page.judge:
-                  return <Jugde enoek={enoekData.enoek} setData={setEnoekData} search={search}></Jugde>;
-                default:
-                  return "sad sounds";
-              }
-            })()}
-            
-              </div>
-            
-          
-          </main>
-        </>
-      );
-      
+        {/*---------------*/}
+        <div className='leftbar'>
+          {/*Buttons to show the diffrent pages related to Enoek where it is shown if the user have the right permission level */}
+          {permissionInt != undefined && permissionInt <= 2 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.overview); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">All Measures</h4></Button>
+              <br></br>
+            </>
+
+          )}
+
+          {permissionInt != undefined && permissionInt <= 2 && (
+            <>
+              <  Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.add); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Add Enoek</h4></Button>
+              <br />
+            </>
+
+          )}
+          {permissionInt != undefined && permissionInt <= 2 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.active); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Active Measures</h4></Button>
+              <br />
+            </>
+
+          )}
+          {permissionInt != undefined && permissionInt <= 1 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.approved); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Approved Measures</h4></Button>
+              <br />
+            </>
+
+          )}
+          {permissionInt != undefined && permissionInt <= 1 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.reject); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Rejected Measures</h4></Button>
+              <br />
+            </>
+
+          )}
+          {permissionInt != undefined && permissionInt <= 2 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.my); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">My measures</h4></Button>
+              <br />
+            </>
+
+          )}
+          {permissionInt != undefined && permissionInt <= 1 && (
+            <>
+              <Button className="mb-[10px]" variant="ghost" onClick={() => { setPage(Page.judge); setSearch(""); }}><h4 className="scroll-m-20 text-xl font-semibold tracking-tight">Accept/reject measures</h4></Button>
+              <br />
+            </>
+
+          )}
+        </div>
+
+        <div className="rightbar">
+          <div className="w-[250px] h-[70px]">
+            <Input type="text" className="outlined-input" value={search} onChange={(event) => setSearch(event.target.value)} placeholder="Search.." />
+          </div>
+          {(() => {
+            {/*Based upon the selected page the content shown differ */ }
+            switch (page) {
+              case Page.overview:
+                return <AllMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></AllMeasures>;
+              case Page.add:
+                return <ManageAdding enoek={enoekData.enoek} setData={setEnoekData} search={search}></ManageAdding>;
+              case Page.active:
+                return <ActiveMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></ActiveMeasures>;
+              case Page.approved:
+                return <Approved enoek={enoekData.enoek} setData={setEnoekData} search={search}></Approved>;
+              case Page.reject:
+                return <Rejected enoek={enoekData.enoek} setData={setEnoekData} search={search}></Rejected>;
+              case Page.my:
+                return <MyMeasures enoek={enoekData.enoek} setData={setEnoekData} search={search}></MyMeasures>;
+              case Page.judge:
+                return <Jugde enoek={enoekData.enoek} setData={setEnoekData} search={search}></Jugde>;
+              default:
+                return "sad sounds";
+            }
+          })()}
+
+        </div>
+
+
+      </main>
+    </>
+  );
+
 };
-  
-  export default MainComponent
\ No newline at end of file
+
+export default MainComponent
\ No newline at end of file
diff --git a/Frontend/power-tracker/src/pages/login.tsx b/Frontend/power-tracker/src/pages/login.tsx
index 9dd4f5972cb013bfb695edd3760db4691a0ee0a6..f477e6fba7ae17a5958fc82837de38032a9a662e 100644
--- a/Frontend/power-tracker/src/pages/login.tsx
+++ b/Frontend/power-tracker/src/pages/login.tsx
@@ -83,24 +83,27 @@ function Login() {
             console.log(error)
             setOpen(true);
         })
-    };
+    }
 
     return(
-        <div id="loginpage"> {/* !! READ ABOUT USING "zod" https://zod.dev to allow client side validation && needed to make SHADUI form !! */}
-        <AlertDialog open={open}>
-            <AlertDialogContent>
-            <AlertDialogHeader>
-                <AlertDialogTitle>Login failed</AlertDialogTitle>
-            </AlertDialogHeader>
-                <div>
-                    Invalid username or password. Please try again.
-                </div>
-            
-            <AlertDialogFooter>
-                <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
-            </AlertDialogFooter>
-            </AlertDialogContent>
-        </AlertDialog>
+        <div id="loginpage"> 
+
+            {/* Failed Login Alert */}
+            <AlertDialog open={open}>
+                <AlertDialogContent>
+                    <AlertDialogHeader>
+                        <AlertDialogTitle>Login failed</AlertDialogTitle>
+                    </AlertDialogHeader>
+                    <div>
+                        Invalid username or password. Please try again.
+                    </div>
+                    <AlertDialogFooter>
+                        <AlertDialogCancel onClick={handleClose}>Close</AlertDialogCancel>
+                    </AlertDialogFooter>
+                </AlertDialogContent>
+            </AlertDialog>
+
+            {/* Log in menu */}
             <div id="logincard">
                 <Card>
                     <CardHeader>
@@ -109,6 +112,7 @@ function Login() {
                     <CardContent>
                         <Form {...loginForm}>
                             <form onSubmit={loginForm.handleSubmit(onSubmit)}>
+                                {/* EMAIL */}
                                 <FormField
                                     control={loginForm.control}
                                     name="email"
@@ -121,6 +125,7 @@ function Login() {
                                         </FormItem>
                                     )}
                                 />
+                                {/* PASSWORD */}
                                 <FormField
                                     control={loginForm.control}
                                     name="password"
diff --git a/Frontend/power-tracker/src/pages/overview.tsx b/Frontend/power-tracker/src/pages/overview.tsx
index c7784481c86fc1c5bba8b9c12a530ec39cbf0e9b..f4b8599b235971752a7b7f039d0412d8697c8f01 100644
--- a/Frontend/power-tracker/src/pages/overview.tsx
+++ b/Frontend/power-tracker/src/pages/overview.tsx
@@ -17,7 +17,7 @@ import { DatePicker } from '@/components/ui/datepicker'
 import { Input } from '@/components/ui/input';
 import { Separator } from "@/components/ui/separator"
 import { Checkbox } from "@/components/ui/checkbox"
-
+import { useToast } from "@/components/ui/use-toast"
 
 
 const IngressAPI: String = import.meta.env.VITE_IAPI_URL
@@ -63,6 +63,8 @@ function Overview() {
     checked: [false]
   })
 
+  const { toast } = useToast()
+
   const [interval, setInterval] = useState(20)  //the interval between each packet of data
   const [since, setSince] = useState(2)         //how long the first packet of data should be fetched from
   const [start, setStart] = useState(0)
@@ -108,18 +110,19 @@ function Overview() {
         <TopBar></TopBar>
         
         <main>
-
+          {/* The Linechart */}
           <div className = "rightbar">
             <div className="h-[100%] w-[100%] relative overflow-auto">
               <LineChart data={buildingData}/>
             </div>
           </div>
 
+          {/* Options and date picker menu for line chart */}
           <div className = "leftbar">
             <div>
 
-              {/* GOTTA IMPLEMENT FUNCTIONALITY TO THE 2 BUTTONS TO CHNAGE INOUT */}
-              <label className='text-primary text-sm'>Minuites between readings</label>
+              {/* Set reading interval, plus/minus buttons */}
+              <label className='text-primary text-sm'>Minutes between readings</label>
               <div className='flex'>
                 <Input className="w-[280px] h-[40px]" type='number' value={interval} onChange={event => setInterval(parseInt(event.target.value))}></Input>
                 <div className="flex flex-col h-[40px] ml-[5px]">
@@ -132,7 +135,7 @@ function Overview() {
                 </div>
               </div>
               
-              {/* DATE FROM PICKER */}
+              {/* DATE FROM datepicker */}
               <label className='text-primary text-sm'>Date From</label>
               <div className='flex'>
                 <DatePicker width={280} dates={endDate} setDate={setEndDate} allowedDate={startDate} />
@@ -159,7 +162,7 @@ function Overview() {
                 </div> 
               </div>
 
-              {/* DATE TO PICKER */}
+              {/* DATE TO datepicker */}
               <label className='text-primary text-sm'>Date To</label>
               <div className='flex mb-[10px]'>
                 <DatePicker width={280} dates={startDate} setDate={setStartDate} allowedDate={new Date()}/>
@@ -214,9 +217,18 @@ function Overview() {
                 </div>
               </div>
               <br/>
-              <div className="flex items-center align-center justify-center mb-[10px]"><Button className="h-[25px] w-[25px]" variant="outline" size="icon" onClick={_ => setRecall(!recall)}><RefreshCw className='h-[15px] w-[15px]'/></Button></div>
+              <div className="flex items-center align-center justify-center mb-[10px]">
+                <Button className="h-[25px] w-[25px]" variant="outline" size="icon" onClick={() => {
+                    setRecall(!recall)
+                    toast({
+                      title: "Refreshed.",
+                    })
+                }}>
+                <RefreshCw className='h-[15px] w-[15px]'/>
+                </Button>
+              </div>
             
-            {/*  */}
+            {/* Building checkbox menu */}
             <div className ="rounded-md border shadow-md px-[5px]">
               {buildingsState.buildings !== null ?  (
                 buildingsState.buildings.map((building, i) => {
@@ -224,10 +236,12 @@ function Overview() {
                     <Accordion type='single' collapsible>
                       <AccordionItem value={i.toString()}>
                       <div id="accordion-bar">
+                        {/* Part that triggers the accordion expansion */}
                         <AccordionTrigger className='mx-[5px]'>
                           <label>{building.name}</label>
                         </AccordionTrigger>
                         <Separator orientation='vertical'></Separator>
+                        {/* Checkbox outside trigger to avoid triggering expansion when checking */}
                         <div className='w-[100%] h-[100%] flex justify-center items-center'>
                           <Checkbox 
                             checked={building.active} 
@@ -246,10 +260,12 @@ function Overview() {
                               <Accordion type='single' collapsible>
                                 <AccordionItem value={i.toString()}>
                                 <div id="accordion-bar">
+                                  {/* Part that triggers the accordion expansion */}
                                   <AccordionTrigger className='mr-[5px] ml-[15px]'>
                                     <label>{department.name}</label>
                                   </AccordionTrigger>
                                   <Separator orientation='vertical'></Separator>
+                                  {/* Checkbox outside trigger to avoid triggering expansion when checking */}
                                   <div className='w-[100%] h-[100%] flex justify-center items-center'>
                                     <Checkbox
                                       checked={department.active} 
@@ -294,7 +310,10 @@ function Overview() {
                   <div></div>
                 )}
               </div>
+
               <br/>
+
+              {/* Process checkbox menu */}
               <div className ="rounded-md border shadow-md px-[5px]">
               {buildingsState.processes !== null ? (
                 buildingsState.processes.map((process, i) => {
@@ -302,10 +321,12 @@ function Overview() {
                     <Accordion type='single' collapsible>
                       <AccordionItem value={i.toString()}>
                       <div id="accordion-bar">
+                        {/* Part that triggers the accordion expansion */}
                         <AccordionTrigger className='mx-[5px]'>
                             <label>{process.name}</label>
                         </AccordionTrigger>
                         <Separator orientation='vertical'></Separator>
+                        {/* Checkbox outside trigger to avoid triggering expansion when checking */}
                         <div className='w-[100%] h-[100%] flex justify-center items-center'>
                           <Checkbox 
                             checked={process.active}