         
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
-    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
-        
-        return items.count
-        
-    }
-    
-    //load the table view based off the items array
-    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
-        
-        let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
-        cell.textLabel?.text = items[indexPath.row]
-        
-        return cell
-        
-    }
-    
-    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
-        
-        let autoCompleteString = items[indexPath.row]
-        let returnString = autoCompleteString.componentsSeparatedByString(" ")
-        
-        textField.text = returnString[0] + " " + returnString[1]
-        
-        tableView.reloadData()
+    //So we can convert "Bob Smith" to "bob_smith"
+    func addUnderscores(var inputString: String) -> String{
+        
+        var returnString = ""
+        
+        let newItemArr = inputString.componentsSeparatedByString(" ")
+        
+        //If there were more than two words in the SI name input
+        if newItemArr.count > 2 {
+                
+            alert("SI Name", alertMessage: "The SI name should only have one space")
+                
+        } else {
+                
+            inputString = newItemArr.joinWithSeparator("_")
+                
+            returnString = inputString.lowercaseString
+                
+        }
+        
+        return returnString
         
     }
 

        
    }
    
    //update the Parse database
    func updateDatabase(columnName: String,rowData: String){
        
        let SIObject = PFObject(className: "SI_Sign_in")
        SIObject[columnName] = rowData
        SIObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in self.updatedDatabaseTrue() }
        
    }
    
    func updatedDatabaseTrue() {
        updatedDatabase = true
    }
    
    //Create an alert with a title, message, and dismiss button
    func alert(alertTitle: String,alertMessage: String){
        
        let alertController = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: UIAlertControllerStyle.Alert)
        
        alertController.addAction(UIAlertAction(title: "dismiss", style: UIAlertActionStyle.Default,handler: nil))
        
        self.presentViewController(alertController, animated: true, completion: nil)
        
    }
    
    //So we can convert "Bob Smith" to "bob_smith"
    func addUnderscores(var inputString: String) -> String{
        
        var returnString = ""
        
        //Check if the string contains a date with forward slashes
        if inputString != "" {
            
            //split string by the spaces, then join it by underscore
            let newItemArr = inputString.componentsSeparatedByString(" ")
            inputString = newItemArr.joinWithSeparator("_")
            
            returnString = inputString.lowercaseString
            
        } else {
            
            alert("Invalid entry", alertMessage: "Empty input")
        
        }
        
        return returnString
        
    }
    
    //Saves the variables we need to remember
    func saveCoreVariables(){


class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {

    // MARK: Global core variables
    
    var personInfo: String = ""
    var items = [String]()
    
    // MARK: App utilities
    
    @IBOutlet var textField: UITextField!
    
    @IBOutlet var textFieldPerson: UITextField!
    
    @IBOutlet var tableView: UITableView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
