             switch(indexPath.section) {
             case 0:
                 switch(indexPath.row) {
-                case 0: //self.userCell.textLabel?.text = "Log Out"
-                    return self.logOutCell   // section 0, row 0 is the first name
-                case 1: return self.userCell    // section 0, row 1 is the last name
-                case 2: return self.userCell
+                case 0: if PFUser.currentUser() != nil { self.userCell.textLabel!.text = "Logged in as " + PFUser.currentUser().username}
+                else {self.userCell.textLabel?.text = "Not logged in"}
+                    return self.userCell  // section 0, row 0 is the first name
+                case 1:
+                    if PFUser.currentUser() != nil {
+                        logOut.setTitle("Log Out", forState: UIControlState.Normal)
+                        logOut.addTarget(self, action: "logOut:", forControlEvents: UIControlEvents.TouchUpInside)
+                    }
+                    else{
+                        logOut.setTitle("Log In", forState: UIControlState.Normal)
+                        logOut.addTarget(self, action: "logIn:", forControlEvents: UIControlEvents.TouchUpInside)
+                    }
+                        self.logOutCell.addSubview(logOut)
+                        return self.logOutCell    // section 0, row 1 is the last name
+                //case 2: return self.logOutCell
                 default: fatalError("Unknown row in section 0")
                 }
             case 1:

        
    
    }


    




class AccountViewController: UITableViewController, UITableViewDelegate, PFLogInViewControllerDelegate {
    
    var userCell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "userCell")
    var logOutCell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "logOutCell")
    
    
    var logOut = UIButton.buttonWithType(UIButtonType.System) as UIButton
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
