             _suggestionsTableView?.tableFooterView = UIView(frame: CGRectZero)
             self.view.insertSubview(_suggestionsTableView!, belowSubview: _settingsBarView!)
         }
+        populateSuggestionsTableView()
+    }
+    
+    func populateSuggestionsTableView() {
         _historyDisplayURLs.removeAll(keepCapacity: false)
+        _historyTopMatches.removeAll(keepCapacity: false)
+        var stringToFind = _searchBar.text
+        var framerMatches = Array<HistoryEntry>()
+        var domainMatches = Array<HistoryEntry>()
+        var titleMatches = Array<HistoryEntry>()
         for entry:HistoryEntry in _history! {
-            if entry.title?.lowercaseString.rangeOfString(_searchBar.text) != nil {
-                _historyDisplayURLs.append(entry)
-            } else if entry.urlString.lowercaseString.rangeOfString(_searchBar.text) != nil {
-                _historyDisplayURLs.append(entry)
-            }
+            var entryUrl = entry.urlString.lowercaseString
+            var entryTitle = entry.title?.lowercaseString
+            println(entryUrl)
+            println(stringToFind)
+            if entryTitle?.rangeOfString(stringToFind) != nil && entryTitle?.rangeOfString("framer studio") != nil {
+                // Put Framer Studio home in the top matches
+                _historyTopMatches.append(entry)
+            } else if entryUrl.rangeOfString(stringToFind) != nil {
+                if stringToFind.lowercaseString.rangeOfString(".framer") != nil {
+                    // is it a framer project URL? these go first
+                    framerMatches.append(entry)
+                } else {
+                    if entryUrl.hasPrefix(stringToFind) && entryUrl.lowercaseString.rangeOfString(".framer") == nil {
+                        // is it a domain match? if it's a letter-for-letter match put in top matches
+                        // unless it's a local Framer Studio URL because that list will get long
+                        _historyTopMatches.append(entry)
+                    } else {
+                        // otherwise add to history
+                        domainMatches.append(entry)
+                    }
+                }
+            } else if entryTitle?.rangeOfString(stringToFind) != nil {
+                // is it a title match? cause these go last
+                titleMatches.append(entry)
+            }
+        _historyDisplayURLs = framerMatches + domainMatches + titleMatches
         }
         _suggestionsTableView?.reloadData()
     }

        _suggestionsTableView = nil
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        var cell:HistoryTableViewCell = HistoryTableViewCell(style: .Subtitle, reuseIdentifier: nil)
        var entry = _historyDisplayURLs[indexPath.row]
        cell.backgroundColor = UIColor.clearColor()
        cell.entry = entry
        return cell

    var _keyboardHeight:CGFloat = 216
    var _suggestionsTableView: UITableView?
    var _history: Array<HistoryEntry>?
    var _historyTopMatches: Array<HistoryEntry> = Array<HistoryEntry>()
    var _historyDisplayURLs: Array<HistoryEntry> = Array<HistoryEntry>()
    
    // Loading progress? Fake it till you make it.
