         
         personInfo = newInfo!
         
-        var newItemArr = newItem!.componentsSeparatedByString(" ")
+        let dataString = addUnderscores(newItem!)
         
-        let firstName: String = newItemArr[0].lowercaseString
-        let lastName: String = newItemArr[1].lowercaseString
-        var date: String = newItemArr[2]
+        //if the data that the user inputted is correct
+        if (dataString != ""){
         
-        if date.rangeOfString("/") != nil{
-            
-            var newDateArr = date.componentsSeparatedByString("/")
-            
-            date = newDateArr[0] + "_" + newDateArr[1] + "_" + newDateArr[2]
-            
-            let submitString = firstName + "_" + lastName + "_" + date
-            
-            print(submitString)
-            
-            items.append(newItem!)
+            items.insert(newItem!, atIndex: 0)
             textField.resignFirstResponder()
             
             textField.text = ""
-            textFieldPerson.text = personInfo
             tableView.reloadData()
             
             saveCoreVariables()
             
-            
-        } else {
-            
-            alert("Date", alertMessage: "Invalid date input")
-            
         }
-    
         
     }
     

        
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
        
        let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)

        
    }
    
    //So we can convert "Bob Smith 10/22/15" to "bob_smith_10_22_15"
    func addUnderscores(inputString: String) -> String{
        
        var returnString = ""
        
        //Check if the string contains a date with forward slashes
        if inputString.rangeOfString("/") != nil {
            
            //split string by the spaces, put in new array
            let newItemArr = inputString.componentsSeparatedByString(" ")
            
            for section in newItemArr {
                
                //if this contains a forward slash this is the section where the date is
                if section.rangeOfString("/") != nil {
                    
                    //replace forward slashes with underscores and add to return String
                    let newDateArr = section.componentsSeparatedByString("/")
                    let submitDate = newDateArr[0] + "_" + newDateArr[1] + "_" + newDateArr[2]
                    returnString += submitDate
                    
                } else {
                    
                    //if this is just a word add it and an underscore to return string
                    returnString += section.lowercaseString + "_"
                    
                }
                
            }
            
        } else if inputString == ""{
            
            alert("Invalid entry", alertMessage: "Empty")
        
        } else {
            
            alert("Invalid entry", alertMessage: "need to use forward slashes for date")
            
        }
        
        return returnString
        
    }
    
    //Saves the variables we need to remember
    func saveCoreVariables(){
        
        let defaults = NSUserDefaults.standardUserDefaults()
