         }*/
     }
     
+    func saveNewUser(name:String, email:String){
+        let usersRef = Firebase(url: "https://glowing-heat-6814.firebaseio.com/users/")
+        let myID = usersRef.authData.uid
+        let jsonUser = ["name":"\(name)", "email":"\(email)"]
+        let newUser = usersRef.childByAppendingPath("\(myID)")
+        newUser.setValue(jsonUser)
+    }
+    
 }

                            self.performSegueWithIdentifier("showGroups", sender: nil)
                        }
                    })
                }
            }
            

        let alertController = UIAlertController(title: "Create account", message: "You can create new account", preferredStyle: .Alert)
        
        let loginAction = UIAlertAction(title: "Create", style: .Default) { (_) in
            let nameTextField = alertController.textFields![0] as UITextField
            let loginTextField = alertController.textFields![1] as UITextField
            let passwordTextField = alertController.textFields![2] as UITextField
            
            self.firebase.createUser(loginTextField.text, password: passwordTextField.text) { (error: NSError!) in
                
