         }
     }
     
+    // heightForMessageBubbleTopLabelAt: Increases the size of the cell
     override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForMessageBubbleTopLabelAt indexPath: IndexPath!) -> CGFloat {
         return 15
     }

        return nil
    }
    
    override func collectionView(_ collectionView: JSQMessagesCollectionView?, attributedTextForMessageBubbleTopLabelAt indexPath: IndexPath!) -> NSAttributedString? {
        let message = messages[indexPath.item]
        switch message.senderId {

        
        // liveQuery for Parse
        // HOW DOES THIS WORK?
        UNUserNotificationCenter.current().delegate = self
        let messageQuery = getMessageQuery()
        subscription = ParseLiveQuery.Client.shared
            .subscribe(messageQuery)
            .handle(Event.created)  { query, pfMessage in
                self.loadMessages(query: self.getMessageQuery())
                
                if pfMessage.roomy?.objectId != self.senderId {
                    let content = UNMutableNotificationContent()
                    content.title = pfMessage.senderName!
                    content.body = pfMessage["text"] as! String
                    content.badge = 1
                    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
                    let request = UNNotificationRequest(identifier: "timerDone", content: content, trigger: trigger)
                    UNUserNotificationCenter.current().delegate = self
                    
                    UNUserNotificationCenter.current().add(request, withCompletionHandler: { (error: Error?) in
                    })
                }
        }
        
        // load messages
        self.loadMessages(query: self.getMessageQuery())

    }
    
