         // No avatars
         collectionView!.collectionViewLayout.incomingAvatarViewSize = CGSizeZero
         collectionView!.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero
-        
+    
+        messageRef = rootRef.childByAppendingPath("messages")
     }
     
-    override func viewDidAppear(animated: Bool) {
-        super.viewDidAppear(animated)
-        
-        // TEST
-        // messages from someone else
-        addMessage("foo", text: "Hey person!")
-        // messages sent from local sender
-        addMessage(senderId, text: "Yo!")
-        addMessage(senderId, text: "I like turtles!")
-        // animates the receiving of a new message on the view
-        finishReceivingMessage()
-        
-        
-        
-    }
     
     override func viewDidDisappear(animated: Bool) {
         super.viewDidDisappear(animated)

        messages.append(message)
    }
    
    
    
}

    var outgoingBubbleImageView: JSQMessagesBubbleImage!
    var incomingBubbleImageView: JSQMessagesBubbleImage!
    
    // Firebase
    // In case you’re wondering, creating another reference doesn’t mean you’re creating another connection. Every reference shares the same connection to the same Firebase database.
    let rootRef = Firebase(url: BASE_URL)
    var messageRef = Firebase()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "Chatyi"
