             }))
             self.presentViewController(alert, animated: true, completion: nil)
         }
-        processData(outputData)
+        processData(outputWordData, isWord: true)
+        processData(outputPhraseData, isWord: false)
     }
     
-    func processData(translations: [String]) {
+    func processData(translations: [String], isWord: Bool) {
         for result in translations {
             // Split the string into word and translation
             let resultArr = result.componentsSeparatedByString("-")
             let word = resultArr[0].stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())
             let gloss = resultArr[1].stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())
-            translationResults.append(TranslationResult(blackfootWord: word, englishGloss: gloss))
+            if (isWord) {
+                self.translationWordResults.append(TranslationResult(blackfootWord: word, englishGloss: gloss))
+            } else {
+                self.translationPhraseResults.append(TranslationResult(blackfootWord: word, englishGloss: gloss))
+            }
         }
     }
     
     // MARK: TableView functions
 
     override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
-        return 1
+        if (!randomWord) {
+            return 2
+        } else {
+            return 1
+        }
     }
     
     override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        if (!randomWord) {
+            if (section == 0) {
+                return 30.0
+            } else {
+                return 15.0
+            }
+        }
         return 3.0
     }
     
     override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
+        if (!randomWord) {
+            if (section == 0) {
+                return "Words"
+            } else if (section == 1) {
+                return "Phrases"
+            }
+        }
         return nil
     }
     
     override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return translationResults.count
+        if (section == 0) {
+            return self.translationWordResults.count
+        } else {
+            return self.translationPhraseResults.count
+        }
     }
     
     override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
         let cellIdentifier = "ResultTableViewCell"
         let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! ResultTableViewCell
-        let translationResult = translationResults[indexPath.row]
-        cell.blackfootWordLabel.text = translationResult.blackfootWord
-        cell.englishGlossLabel.text = translationResult.englishGloss
+        if (indexPath.section == 0) {
+            let translationResult = self.translationWordResults[indexPath.row]
+            cell.blackfootWordLabel.text = translationResult.blackfootWord
+            cell.englishGlossLabel.text = translationResult.englishGloss
+        } else {
+            let translationResult = translationPhraseResults[indexPath.row]
+            cell.blackfootWordLabel.text = translationResult.blackfootWord
+            cell.englishGlossLabel.text = translationResult.englishGloss
+        }
         return cell
     }
     
     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
         if segue.identifier == "RowSelectionSegue" {
             let vc: ResultViewController = segue.destinationViewController as! ResultViewController
-            vc.englishGloss = selectedData.englishGloss
-            vc.blackfootWord = selectedData.blackfootWord
+            vc.englishGloss = self.selectedData.englishGloss
+            vc.blackfootWord = self.selectedData.blackfootWord
         }
     }
     
     override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
-        selectedData = translationResults[indexPath.row]
+        if (indexPath.section == 0) {
+            self.selectedData = self.translationWordResults[indexPath.row]
+        } else {
+            self.selectedData = self.translationPhraseResults[indexPath.row]
+        }
         performSegueWithIdentifier("RowSelectionSegue", sender: self)
     }
 }
    var inputText: String!
    var selectedData: TranslationResult!
    var randomWord: Bool = false
    var translationResults = [TranslationResult]()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.tableView.contentInset = UIEdgeInsetsMake(-1.0, 0.0, 0.0, 0.0)
        if (randomWord) {
            self.navigationItem.title = "Random Word"
            loadRandomWord()
        } else {
            self.navigationItem.title = "Results"

    
    func loadRandomWord() {
        let outputData = TranslationEngineWrapper.queryRandomWord()
        processData(outputData, isWord: true)
    }
    
    func loadTranslatedResults() {
        let outputWordData = TranslationEngineWrapper.queryWordMatches(inputText)
        let outputPhraseData = TranslationEngineWrapper.queryPhraseMatches(inputText)
        if (outputWordData.count == 0 && outputPhraseData.count == 0) {
            let alert = UIAlertController(title: "No Results Found",
                                          message: "No Matching Word in Dictionary",
                                          preferredStyle: UIAlertControllerStyle.Alert)
