             return;
         }
         
+        let isEmailAddressValid = isValidEmailAddress(emailAddressString: email!)
+        
+        if isEmailAddressValid
+        {
+            print("Email address is valid")
+            
+        } else {
+            print("Email address is not valid")
+            displayAlertMessage(userMessage: "Email address is not valid")
+        }
+        
        // Check email is in email format
-        let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
-        if(email != emailRegEx)
-        {
-            self.displayAlertMessage(userMessage: "It appears you haven't entered a invalid email.")
-        }
+//        let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
+//        if(email != emailRegEx)
+//        {
+//            displayAlertMessage(userMessage: "You entered an invalid email address.")
+//            return;
+//        }
         
         // Check if passwords match
         if(password != confirmPassword)

        let password = userPasswordTextField.text;
        let confirmPassword = userConfirmPasswordTextField.text;
        
        
        
        // Check for empty fields

                
                
                print(error!)
                return;
            }
            
            guard let uid = user?.uid else{
