                        forCellReuseIdentifier: FriendCell.identifier)
     tableView.allowsMultipleSelection = true
   }
+
+  func cancelTapped() {
+    self.dismiss(animated: true, completion: nil)
+  }
+
+  func doneTapped() {
+    self.dismiss(animated: true, completion: nil)
+  }
 }
 
 extension FriendPickerViewController : UITableViewDataSource {
   func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)
       -> UITableViewCell {
     guard
-      let cellInfo = dataSource.cells[safe: indexPath.row] as? FriendCellInfo,
+        let key = dataSource.sortedFriends.keys.sorted()[safe: indexPath.section],
+      let contacts = dataSource.sortedFriends[key],
+      let contact = contacts[safe: indexPath.row],
       let cell =
-          tableView.dequeueReusableCell(withIdentifier: cellInfo.cellIdentifier,
+          tableView.dequeueReusableCell(withIdentifier: FriendCell.identifier,
                                         for: indexPath)
               as? ConfigurableTableViewCell
     else {
       return UITableViewCell()
     }
 
+    let cellInfo = dataSource.cells.filter { (ci) in
+      return (ci as! FriendCellInfo).fbid == contact
+    }.first! as! FriendCellInfo
     cell.configure(cellInfo: cellInfo)
     cell.accessoryType =
         dataSource.selectedFriends.contains(cellInfo.fbid) ? .checkmark : .none

        self.cells.append(FriendCellInfo(fbid: friend.fbid,
                                         name: friend.display_name,
                                         picture: friend.picture_url))
        onMain {
          completion()
        }

  override func viewDidLoad() {
    super.viewDidLoad()

    configureNavigationBar()
    configureTableView()

    // TODO(compnerd) color the background to .clear
