diff --git a/flag_friend.info b/flag_friend.info
index 56f966b..fe278d3 100644
--- a/flag_friend.info
+++ b/flag_friend.info
@@ -1,6 +1,6 @@
 name = Flag friend
 description = Flag users as friends. Implements it's own flag and a form for sending a user a message upon flag.
-dependencies[] = flag (2.1)
+dependencies[] = flag (>=3.0)
 core = 7.x
 package = Flags
 files[] = flag_friend.install
@@ -9,8 +9,10 @@ files[] = flag_friend.test
 files[] = includes/flag_friend.views.inc
 files[] = includes/flag_friend.views_default.inc
 files[] = includes/flag_friend_handler_argument_apachesolr_friend.inc
-files[] = includes/flag_friend_handler_argument_numeric.inc
-files[] = includes/flag_friend_handler_field_links.inc
+files[] = includes/flag_friend_views_handler_field_links.inc
+files[] = includes/flag_friend_views_handler_field_status.inc
+files[] = includes/flag_friend_views_handler_filter_status.inc
+files[] = includes/flag_friend_plugin_access_pending_requested.inc
 files[] = access/flag_friend_is_friend.inc
 files[] = content_types/flag_friend_count.inc
 files[] = content_types/flag_friend_links.inc
diff --git a/flag_friend.install b/flag_friend.install
index 8800c71..7fae0ad 100644
--- a/flag_friend.install
+++ b/flag_friend.install
@@ -14,6 +14,8 @@ function flag_friend_install() {
 
 /**
  * Implements hook_uninstall().
+ *
+ * @TODO: We should consider removing all friend flags when uninstalling...
  */
 function flag_friend_uninstall() {
   // Remove default flag if it's enabled.
@@ -29,33 +31,42 @@ function flag_friend_uninstall() {
 function flag_friend_schema() {
   $schema['flag_friend'] = array(
     'fields' => array(
-      'uid' => array(
+      'flagging_id' => array(
+        'description' => 'The unique ID for this particular flag.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
-        'disp-width' => '10'
       ),
-      'friend_uid' => array(
+      'status' => array(
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'disp-width' => '10'
       ),
+      'uid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => "Flagging user ID.",
+      ),
+      'entity_id' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => "Flagged user ID."
+      ),
       'created' => array(
         'type' => 'int',
         'not null' => FALSE,
         'disp-width' => '11'
-      )
-    ),
-    'primary key' => array('uid', 'friend_uid'),
-    'indexes' => array(
-      'friend_uid' => array('friend_uid'),
+      ),
     ),
+    'primary key' => array('flagging_id'),
   );
 
   $schema['flag_friend_message'] = array(
     'fields' => array(
-      'fcid' => array(
+      'flagging_id' => array(
         'type' => 'serial',
         'not null' => TRUE,
       ),
@@ -64,7 +75,7 @@ function flag_friend_schema() {
         'not null' => TRUE
       )
     ),
-    'primary key' => array('fcid'),
+    'primary key' => array('flagging_id'),
   );
   return $schema;
 }
@@ -74,7 +85,7 @@ function flag_friend_schema() {
  */
 function flag_friend_update_6000() {
   db_drop_primary_key('flag_friend_message');
-  db_change_field('flag_friend_message', 'fcid', 'fcid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('fcid')));
+  db_change_field('flag_friend_message', 'fcid', 'fcid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('flagging_id')));
   return st('Field type changed.');
 }
 
@@ -110,3 +121,91 @@ function flag_friend_update_7001() {
     db_query("DELETE ff FROM {flag_friend} ff WHERE ff.uid = :uid AND ff.friend_uid = :friend_uid", array(':uid' => $uid, ':friend_uid' => $friend_uid));
   }
 }
+
+/**
+ * Update the flag_friend table to assume flags persist.
+ */
+function flag_friend_update_7002() {
+
+  // Rename the the flag_friend table to flag_friend_old.
+  db_rename_table('flag_friend', 'flag_friend_old');
+
+  // Create the new flag_friend table.
+  $schema = flag_friend_schema();
+  db_create_table('flag_friend', $schema['flag_friend']);
+
+  // Change the primary key of flag_friend_message.
+  db_add_index('flag_friend_message', 'temp', array('fcid'));
+  db_drop_primary_key('flag_friend_message');
+  db_change_field('flag_friend_message', 'fcid', 'flagging_id',
+    array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+    array('primary key' => array('flagging_id'))
+  );
+  db_drop_index('flag_friend_message', 'temp');
+}
+
+/**
+ * Record friend status based on existing flags.
+ */
+function flag_friend_update_7003() {
+  // Get the friend flag.
+  $flag = flag_get_flag('friend');
+
+  // Query the database directly, as there's no API call in Flag 2.x.
+  $result = db_select('flagging', 'fc')
+    ->fields('fc', array('flagging_id', 'entity_id', 'uid', 'timestamp'))
+    ->condition('fid', $flag->fid)
+    ->execute();
+
+  // Insert all pending relationships into the table.
+  foreach ($result as $row) {
+    db_insert('flag_friend')
+      ->fields(array(
+          'flagging_id' => $row->flagging_id,
+          'status' => FLAG_FRIEND_PENDING,
+          'created' => $row->timestamp,
+          'uid' => $row->uid,
+          'entity_id' => $row->entity_id,
+        ))
+      ->execute();
+  }
+}
+
+/**
+ * Re-flag friended user accounts.
+ */
+function flag_friend_update_7004(&$sandbox) {
+  $max_entries_per_round = 100;
+
+  if (!isset($sandbox['progress'])) {
+    $sandbox['progress'] = 0;
+    $sandbox['max'] = db_query('SELECT COUNT(*) FROM {flag_friend_old}')->fetchField();
+  }
+
+  // Query 100 items from the flag_friend_old table.
+  $result = db_select('flag_friend_old', 'ffo')
+    ->fields('ffo', array('uid', 'friend_uid', 'created'))
+    ->range(0, $max_entries_per_round)
+    ->execute();
+
+  // Reflag friended users.
+  foreach ($result as $row) {
+    flag('flag', 'friend', $row->friend_uid, user_load($row->uid));
+    flag('flag', 'friend', $row->uid, user_load($row->friend_uid));
+    db_delete('flag_friend_old')
+      ->condition('uid', $row->uid)
+      ->condition('friend_uid', $row->friend_uid)
+      ->execute();
+    $sandbox['progress']++;
+  }
+
+  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
+
+  if ($sandbox['#finished'] >= 1) {
+    // Delete the old friend table.
+    db_drop_table('flag_friend_old');
+
+    // Finally clear the cache.
+    cache_clear_all();
+  }
+}
diff --git a/flag_friend.module b/flag_friend.module
index 092fa8a..2a1e555 100644
--- a/flag_friend.module
+++ b/flag_friend.module
@@ -6,67 +6,250 @@
  */
 
 // define our statuses
-define('FLAG_FRIEND_BOTH', 0);
-define('FLAG_FRIEND_FLAGGED', 1);
-define('FLAG_FRIEND_UNFLAGGED', 2);
-define('FLAG_FRIEND_APPROVAL', 3);
-define('FLAG_FRIEND_PENDING', 4);
+define('FLAG_FRIEND_BOTH', 0); // Users are friends
+define('FLAG_FRIEND_FLAGGED', 1); // Users are friends
+define('FLAG_FRIEND_UNFLAGGED', 2); // Neither user is flagged as a friend
+define('FLAG_FRIEND_APPROVAL', 3); // User has been flagged, pending their approval
+define('FLAG_FRIEND_PENDING', 4); // 1 user has flagged the other user
+
+/**
+ * Implements hook_views_access().
+ */
+function flag_friend_views_access() {
+  global $user;
+  if ($user->uid == arg(1)) {
+    return TRUE;
+  }
+  else {
+    return FALSE;
+  }
+}
+
+/**
+ * Implements hook_menu_alter().
+ *
+ * Todo: Figure out why we have this.
+ */
+function flag_friend_menu_alter(&$items) {
+  $items['flag/%/%flag/%']['page callback'] = 'flag_friend_page';
+}
+
+/**
+ * Alters the friend flagging confirmation page.
+ *
+ * @param $action
+ *  A string of the action to perform.
+ * @param $flag
+ *  The flag object.
+ * @param $entity_id
+ *  The entity ID being flagged.
+ */
+function flag_friend_page($action, $flag, $entity_id) {
+  if ($action != 'unflag') {
+    // we only want to alter unflagging
+    flag_page($action, $flag, $entity_id);
+  }
+  else {
+    global $user;
+    $flagging_id = db_query("SELECT flagging_id FROM {flag_friend} WHERE entity_id = :entity_id AND uid = :uid", array(':entity_id' => $entity_id, ':uid' => $user->uid))->fetchField();
+    if ($flagging_id) {
+      // if we are unflagging a reciprocal relationship, proceed as usual
+      // with the flag module.
+      flag_page($action, $flag, $entity_id);
+    }
+    else {
+      // if we are acting on a deny link, we need the FID and original flagging
+      // user account to pass to into hook_flag
+      $flagging_id = db_query("SELECT flagging_id FROM {flag_friend} WHERE entity_id = :entity_id AND uid = :uid", array(':entity_id' => $user->uid, ':uid' => $entity_id))->fetchField();
+      $account = user_load($entity_id);
+      flag_friend_flag('unflag', $flag, $user->uid, $account, $flagging_id, $_REQUEST['token']);
+    }
+  }
+}
 
 /**
  * Implements hook_flag().
+ *
+ * We've added a $token param which is passed in if the function is called from flag_friend_page,
+ * our override for flag_page in case a deny function is clicked.
+ *
+ * @see flag_friend_flag_flag(), flag_friend_flag_unflag()
  */
-function flag_friend_flag($event, $flag, $content_id, $account) {
+function flag_friend_flag($op, $flag, $entity_id, $account, $flagging_id, $token = NULL) {
   if ($flag->name == 'friend') {
-    if ($event == 'flag') {
-
-      // See the status of the friendship.
-      $status = flag_friend_determine_friend_status($flag, $account->uid, $content_id, TRUE);
-      $friend_account = user_load($content_id);
-
-      // If both are now flagged, we record the relationship and remove the flags.
-      if ($status === FLAG_FRIEND_BOTH) {
-        // Ensure no duplicates are made.
-        $exists = db_query("SELECT COUNT(1) FROM {flag_friend} WHERE (uid = :uid AND friend_uid = :friend_uid) OR (uid = :friend_uid AND friend_uid = :uid)", array(':uid' => $account->uid, ':friend_uid' => $content_id))->fetchField();
-        if (!$exists) {
-          $id = db_insert('flag_friend')
-            ->fields(array(
-              'uid' => $account->uid,
-              'friend_uid' => $content_id,
-              'created' => $_SERVER['REQUEST_TIME'],
-            ))
-            ->execute();
-        }
+    if ($op == 'flag') {
+      flag_friend_flag_flag($flag, $entity_id, $account, $flagging_id, $token);
+    }
+    elseif ($op == 'unflag') {
+      flag_friend_flag_unflag($flag, $entity_id, $account, $flagging_id, $token);
+    }
+  }
+}
 
-        // Remove any message entries for either user.
-        flag_friend_message('unflag', $flag, $account->uid, $content_id);
-        flag_friend_message('unflag', $flag, $content_id, $account->uid);
+/**
+ * Flags a user as a friend.
+ *
+ * @param $flag
+ *  The flag object.
+ * @param $entity_id
+ *  The ID of the user to flag.
+ * @param $account
+ * @param $flagging_id
+ * @param null $token
+ */
+function flag_friend_flag_flag($flag, $entity_id, $account, $flagging, $token = NULL) {
+  // See the status of the friendship.
+  $status = flag_friend_determine_friend_status($flag, $entity_id, $account->uid, TRUE);
+  $friend_account = user_load($entity_id);
+
+  // FLAG_FRIEND_UNFLAGGED -- need to add a pending relationship
+  if ($status === FLAG_FRIEND_UNFLAGGED) {
+    // Insert new entry into the flag friend table.
+    $result = db_insert('flag_friend')
+      ->fields(array(
+        'flagging_id' => $flagging->flagging_id,
+        'status' => FLAG_FRIEND_PENDING,
+        'created' => REQUEST_TIME,
+        'uid' => $account->uid,
+        'entity_id' => $entity_id,
+      ))->execute();
+
+    // Invoke rules for the new friend relationship.
+    if (function_exists('rules_invoke_event_by_args')) {
+      rules_invoke_event_by_args('flag_friend_request', array(
+        'receiving_user' => $entity_id,
+        'requesting_user' => $account,
+      ));
+    }
 
-        // Then remove the flags.
-        $flag->flag('unflag', $content_id, $account);
-        $flag->flag('unflag', $account->uid, $friend_account);
+    // Invoke triggers.
+    module_invoke_all('flag_friend', 'request', $entity_id, $account, $flag);
+  }
+  elseif ($status === FLAG_FRIEND_APPROVAL) {
+    // FLAG_FRIEND_APPROVAL -- Need to approve an existing friendship.
+    // User B has already flagged the current user A. Now A is approving the
+    // relationship by flagging B back.
 
-        // fire trigger
-        module_invoke_all('flag_friend', 'approve', $friend_account, $account, $flag);
+    // Insert the current user's flagging into the flag friend table.
+    $result = db_insert('flag_friend')
+      ->fields(array(
+        'flagging_id' => $flagging->flagging_id,
+        'status' => FLAG_FRIEND_FLAGGED,
+        'created' => REQUEST_TIME,
+        'uid' => $account->uid,
+        'entity_id' => $entity_id,
+      ))->execute();
+
+    // Query the database for user B's flagging.
+    $flagging_id2 = db_query("SELECT flagging_id FROM {flag_friend} WHERE entity_id = :account AND uid = :entity_id", array(':account' => $account->uid, ':entity_id' => $entity_id))->fetchField();
+
+    // Update user B's flagging in the flag friend table.
+    $query = db_update('flag_friend')
+      ->fields(array('status' => FLAG_FRIEND_FLAGGED))
+      ->condition(db_and()
+        ->condition('flagging_id', $flagging_id2)
+        ->condition('status', FLAG_FRIEND_PENDING))
+      ->execute();
 
-        if (function_exists('rules_invoke_event_by_args')) {
-          rules_invoke_event_by_args('flag_friend_approve', array(
-            'approving_user' => $account,
-            'requesting_user' => $friend_account,
-          ));
-        }
+    // Remove any message entries for either user.
+    flag_friend_message('unflag', $flag, $account->uid, $entity_id);
+    flag_friend_message('unflag', $flag, $entity_id, $account->uid);
+
+    // Invoke rules for the approved relationship.
+    if (function_exists('rules_invoke_event_by_args')) {
+      rules_invoke_event_by_args('flag_friend_approve', array(
+        'approving_user' => $account,
+        'requesting_user' => $entity_id,
+      ));
+    }
+  }
+
+  // fire btrigger
+  module_invoke_all('flag_friend', 'approve', $entity_id, $account, $flag);
+}
+
+/**
+ * Unflags a user.
+ *
+ * @param $flag
+ * @param $entity_id
+ * @param $account
+ * @param $flagging
+ * @param null $token
+ */
+function flag_friend_flag_unflag($flag, $entity_id, $account, $flagging, $token = NULL) {
+  // Get the friend status.
+  $status = flag_friend_determine_friend_status($flag, $entity_id, $account->uid, TRUE);
+
+  $fids = array($flagging->flagging_id);
+
+  foreach (flag_friend_get_flags($flag, $entity_id, $account->uid, $reset = NULL) as $current_flagging) {
+    if ($current_flagging->flagging_id != $flagging->flagging_id) {
+      // We need to delete the reciprocal flag in the flagging table.
+      // This should be done via the $flag object to ensure the hooks are fired
+      // but it didn't seem to work.
+      $friend_delete = db_delete('flagging')
+        ->condition('flagging_id', $current_flagging->flagging_id)
+        ->execute();
+
+      $fids[] = $current_flagging->flagging_id;
+    }
+  }
+
+  $num_deleted = db_delete('flag_friend')
+    ->condition('flagging_id', $fids, 'IN')
+    ->execute();
+
+  // If this function is being called by flag_friend_page, our deny link
+  // we need to mimic the flag module behaviour. This is taken from the
+  // flag module flag_page function.
+  if ($token) {
+    global $user;
+    // Shorten up the variables that affect the behavior of this page.
+    $js = isset($_REQUEST['js']);
+
+    // Specifically $_GET to avoid getting the $_COOKIE variable by the same key.
+    $has_js = isset($_GET['has_js']);
+
+    // Check the flag token, then perform the flagging.
+    // This is different from flag module in that we are passing the
+    // account uid as the $entity_id. This is because the situation is reversed
+    // since the user acting on the flag is the actual $entity_id and not the
+    // owner of the flag.
+    if (!flag_check_token($token, $account->uid)) {
+      $error = t('Bad token. You seem to have followed an invalid link.') . ' ' . $token;
+    }
+    elseif ($user->uid == 0 && !$has_js) {
+      $error = t('You must have JavaScript and cookies enabled in your browser to flag content.');
+    }
+    // If an error was received, set a message and exit.
+    if (isset($error)) {
+      if ($js) {
+        drupal_add_http_header('Content-Type', 'text/javascript; charset=utf-8');
+        print drupal_json_encode(array(
+          'status' => FALSE,
+          'errorMessage' => $error,
+        ));
+        drupal_exit();
       }
       else {
-        // fire trigger
-        module_invoke_all('flag_friend', 'request', $friend_account, $account, $flag);
-
-        if (function_exists('rules_invoke_event_by_args')) {
-          rules_invoke_event_by_args('flag_friend_request', array(
-            'receiving_user' => $friend_account,
-            'requesting_user' => $account,
-          ));
-        }
+        drupal_set_message($error);
+        drupal_access_denied();
+        return;
       }
     }
+
+    // If successful, return data according to the request type.
+    if ($js) {
+      drupal_add_http_header('Content-Type', 'text/javascript; charset=utf-8');
+      $flag->link_type = 'toggle';
+      print drupal_json_encode(flag_build_javascript_info($flag, $account->uid));
+      drupal_exit();
+    }
+    else {
+      drupal_set_message($flag->get_label('unflag_message', $entity_id));
+      drupal_goto();
+    }
   }
 }
 
@@ -82,6 +265,9 @@ function flag_friend_init() {
 
 /**
  * Implements hook_preprocess_flag().
+ *
+ * We preprocess the flag for two reasons: To modify the text of the flagging,
+ * and to change the link URL for removing a friend flagging.
  */
 function flag_friend_preprocess_flag(&$vars) {
   // this hook preprocesses ALL flag links, so make sure we have ours
@@ -89,8 +275,10 @@ function flag_friend_preprocess_flag(&$vars) {
     global $user;
 
     // Determine what the status in the friend process is.
-    $status = flag_friend_determine_friend_status($vars['flag'], $user->uid, $vars['content_id']);
+    $status = flag_friend_determine_friend_status($vars['flag'], $vars['entity_id'], $user->uid);
+
     switch ($status) {
+      // Relationship has yet to be approved, change link text.
       case FLAG_FRIEND_PENDING:
         $vars['link_text'] = t('Friend Requested. Cancel?');
         break;
@@ -135,6 +323,8 @@ function flag_friend_views_api() {
 
 /**
  * Implements hook_form_alter().
+ *
+ * Todo: Figure out why we have this.
  */
 function flag_friend_form_flag_form_alter(&$form, &$form_state, $form_id) {
   if ($form['#flag']->name == 'friend') {
@@ -182,40 +372,84 @@ function flag_friend_rules_event_info() {
 }
 
 /**
- * Retrieve pending friend flags.
+ * Function to get the $flagging_id for a given user / content id
  *
  * @param $flag
  *   The flag object.
- * @param $content_id
- *   The content we're operating on.
- * @param $reset
- *   Boolean trigger to reset the static cache.
+ * @param $entity_id
+ *   The account id of the user being acted on.
+ * @param $uid
+ *   The account id of the logged in user.
  * @return
- *   Array of pending friend flags.
+ *   An array containing information for each flag content id found
  */
-function flag_friend_get_flags($flag, $content_id, $reset = NULL) {
-  static $flagged_content;
-  $uid = $content_id;
-  $content_type = $flag->content_type;
-
-  if (!isset($flagged_content[$uid][$content_type][$content_id]) || $reset) {
-    $flags = flag_get_flags($flag->content_type);
-    $flagged_content[$uid][$content_type][$content_id] = array();
-
-    // get flags with messages
-    $results = db_query("SELECT fc.*, ffm.message FROM {flag_content} fc LEFT JOIN {flag_friend_message} ffm ON ffm.fcid = fc.fcid WHERE fc.fid = :fc.fid AND fc.content_type = :fc.content_type AND fc.content_id = :fc.content_id", array(':fc.fid' => $flag->fid, ':fc.content_type' => $content_type, ':fc.content_id' => $content_id))->fetchAll();
-    foreach ($result as $new_flag) {
-      $fcid = flag_friend_get_fcid($flag, $content_id, $new_flag->uid);
-      $flagged_content[$uid][$content_type][$content_id][$fcid] = $new_flag;
-      $flagged_content[$uid][$content_type][$content_id][$fcid]->user = user_load($new_flag->uid);
+
+function flag_friend_get_flags($flag, $entity_id, $uid, $reset = FALSE) {
+  // TODO: Need to come back to the static cache
+  /*
+  $records = &drupal_static(__FUNCTION__, array(), $reset);
+  if (!empty($records)) {
+    return $records;
+  }
+  */
+
+  $query = db_select('flagging', 'fc');
+  $query->join('flag_friend', 'ff', 'ff.flagging_id = fc.flagging_id');
+  $query
+  ->fields('fc', array('flagging_id', 'entity_id', 'uid'))
+  ->fields('ff', array('status'))
+  ->condition(db_or()
+    ->condition(db_and()
+      ->condition('fc.entity_id', $entity_id)
+      ->condition('fc.uid', $uid))
+    ->condition(db_and()
+      ->condition('fc.entity_id', $uid)
+      ->condition('fc.uid', $entity_id)));
+  $result = $query->execute();
+
+  $records = array();
+
+  foreach ($result as $record) {
+    $records[] = $record;
+  }
+  return $records;
+}
+
+/**
+ * Retrieve a list of friends for the given user.
+ *
+ * @param $uid
+ *   The user id.
+ * @return
+ *   Array of UIDs that are friends of the given user.
+ */
+function flag_friend_get_friends_query($uid) {
+  $query = db_select('flag_friend', 'ff');
+  $query->condition(db_or()
+    ->condition('ff.uid', $uid)
+    ->condition('ff.entity_id', $uid))
+    ->condition('ff.status', FLAG_FRIEND_FLAGGED)
+    ->fields('ff', array('uid', 'entity_id'));
+  $results = $query->execute();
+
+  $friends = array();
+
+  foreach ($results as $friend) {
+    // We'll get two results for each friendship. Need to make sure we only
+    // assign one to the return array.
+    if ($friend->uid == $uid) {
+      $friends[$friend->entity_id] = $friend->entity_id;
+    }
+    elseif ($friend->entity_id == $uid) {
+      $friends[$friend->uid] = $friend->uid;
     }
   }
 
-  return $flagged_content[$uid][$content_type][$content_id];
+  return $friends;
 }
 
 /**
- * Retrieve a list of friends for the given user.
+ * Retrieve each loaded friend for the given user.
  *
  * @param $uid
  *   The user id.
@@ -225,25 +459,16 @@ function flag_friend_get_flags($flag, $content_id, $reset = NULL) {
  *   Array of user objects.
  */
 function flag_friend_get_friends($uid, $reset = NULL) {
-  static $friends;
+  static $cache = array();
 
-  if (!isset($friends[$uid]) || $reset) {
-    $friends[$uid] = array();
-    $results = db_query("SELECT * FROM {flag_friend} WHERE uid = :uid OR friend_uid = :friend_uid", array(':uid' => $uid, ':friend_uid' => $uid))->fetchAll();
-    foreach ($results as $friend) {
-      // if the current user is in the uid column
-      if ($friend->uid == $uid) {
-        // load the friend_uid
-        $friends[$uid][$friend->friend_uid] = user_load($friend->friend_uid);
-      }
-      else { // the current user is the friend_uid
-        // load the uid column as the friend
-        $friends[$uid][$friend->uid] = user_load($friend->uid);
-      }
+  if (!isset($cache[$uid]) || $reset) {
+    $cache[$uid] = array();
+    $friends = flag_friend_get_friends_query($uid);
+    foreach ($friends as $friend) {
+      $cache[$uid][$friend] = (array) user_load($friend);
     }
   }
-
-  return $friends[$uid];
+  return $cache[$uid];
 }
 
 /**
@@ -259,16 +484,19 @@ function flag_friend_get_friends($uid, $reset = NULL) {
 function flag_friend_get_friend_count($uid, $reset = NULL) {
   static $friend_count;
 
-  if (!isset($friend_count[$uid]) || $reset) {
-    $sql = "SELECT COUNT(1) FROM {flag_friend} WHERE uid = %d OR friend_uid = %d";
-    $friend_count[$uid] = db_query("SELECT COUNT(1) FROM {flag_friend} WHERE uid = :uid OR friend_uid = :uid", array(':uid' => $uid, ':friend_uid' => $uid))->fetchField();
+  if (!isset($friends[$uid]) || $reset) {
+    $friends = flag_friend_get_friends_query($uid);
+    $friend_count = count($friends);
   }
 
-  return $friend_count[$uid];
+  return $friend_count;
 }
 
 /**
  * Implements hook_form_alter().
+ *
+ * Change the user registration and user profile form to include
+ * setting for flag friend.
  */
 function flag_friend_form_alter(&$form, &$form_state, $form_id) {
   if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') && $form['#user_category'] == 'account') {
@@ -315,6 +543,8 @@ function flag_friend_account_fieldset_remove_if_empty($element) {
 
 /**
  * Implements hook_user_presave().
+ *
+ * Stash the flag friend settings in the user account data array.
  */
 function flag_friend_user_presave(&$edit, $account, $category) {
   if (isset($edit['flag_friend_request_notify'])) {
@@ -326,16 +556,15 @@ function flag_friend_user_presave(&$edit, $account, $category) {
 }
 
 /**
- * Implements hook_user_cancel().
+ * Implements hook_user_delete()
+ *
+ * Delete all the user's friend flaggings when deleting their account.
  */
-function flag_friend_user_cancel($edit, $account, $method) {
-  // remove any friend relationships if an account is removed
+function flag_friend_user_delete($account) {
   db_delete('flag_friend')
-  ->condition(
-    db_or()
+  ->condition(db_or()
     ->condition('uid', $account->uid)
-    ->condition('friend_uid', $account->uid)
-  )
+    ->condition('entity_id', $account->uid))
   ->execute();
 }
 
@@ -349,7 +578,7 @@ function flag_friend_user_view($account, $view_mode) {
       $account->content['flags'][$flag->name]['#access'] = FALSE;
     }
     else {
-      $status = flag_friend_determine_friend_status($flag, $GLOBALS['user']->uid, $account->uid);
+      $status = flag_friend_determine_friend_status($flag, $account->uid, $GLOBALS['user']->uid);
       if ($status == FLAG_FRIEND_APPROVAL) {
         $account->content['flags'][$flag->name]['#markup'] .= flag_friend_create_link('unflag', $account->uid);
       }
@@ -367,14 +596,8 @@ function flag_friend_user_view($account, $view_mode) {
  */
 function flag_friend_create_link($type, $uid) {
   $flag = flag_get_flag('friend');
-  if ($type == 'unfriend') {
-    $link = str_replace(t('Approve'), t('Deny'), str_replace('unflag', 'unfriend', $flag->theme('unflag', $uid)));
-    return $link;
-  }
-  else {
-    $link = str_replace(t('Approve'), t('Deny'), $flag->theme('unflag', $uid));
-    return $link;
-  }
+  $link = str_replace(t('Approve'), t('Deny'), $flag->theme('unflag', $uid));
+  return $link;
 }
 
 /**
@@ -382,82 +605,56 @@ function flag_friend_create_link($type, $uid) {
  *
  * @param $flag
  *   The flag object.
- * @param $uid1
- *   The account id of one of the users.
- * @param $uid2
- *   The account id of the other user.
+ * @param $entity_id
+ *   The account id of the user being acted on.
+ * @param $uid
+ *   The account id of the logged in user.
  * @return
  *   A string describing the status of the relationship.
  * @todo: this could possibly go into hook_flag_access once available.
  */
-function flag_friend_determine_friend_status($flag, $uid1, $uid2, $reset = NULL) {
-  static $status_cache = array();
-  if ($reset) {
-    unset($status_cache);
-  }
-  // always keep these in the same order
-  if ($uid1 > $uid2) {
-    $key1 = $uid1;
-    $key2 = $uid2;
-  }
-  else {
-    $key1 = $uid2;
-    $key2 = $uid1;
-  }
-
+function flag_friend_determine_friend_status($flag, $entity_id, $uid, $reset = NULL) {
   if (isset($flag)) {
-    if (!isset($status_cache[$key1][$key2])) {
-      $you_are_flagged = $flag->is_flagged($uid1, $uid2);
-      $they_are_flagged = $flag->is_flagged($uid2, $uid1);
-
-      $friends = db_select('flag_friend', 'ff')
-        ->fields('ff', array('created'))
-        ->condition(db_or()
-          ->condition(db_and()
-            ->condition('uid', $uid1)
-            ->condition('friend_uid', $uid2)
-          )
-          ->condition(db_and()
-            ->condition('uid', $uid2)
-            ->condition('friend_uid', $uid1)
-          )
-        )
-        ->execute()->fetchField();
+    $records = flag_friend_get_flags($flag, $entity_id, $uid, TRUE);
 
-      // see if these users have flagged eachother
-      if ($you_are_flagged && $they_are_flagged) {
-        $status_cache[$key1][$key2] = FLAG_FRIEND_BOTH;
-      }
-      elseif ($friends) {
-        $status_cache[$key1][$key2] = FLAG_FRIEND_FLAGGED;
-      }
-      elseif (!$you_are_flagged && !$they_are_flagged) {
-        $status_cache[$key1][$key2] = FLAG_FRIEND_UNFLAGGED;
-      }
-      elseif ($you_are_flagged && !$they_are_flagged) {
-        $status_cache[$key1][$key2] = FLAG_FRIEND_APPROVAL;
-      }
-      elseif (!$you_are_flagged && $they_are_flagged) {
-        $status_cache[$key1][$key2] = FLAG_FRIEND_PENDING;
-      }
+    if (empty($records)) {
+      // Neither user has every flagged each other.
+      return FLAG_FRIEND_UNFLAGGED;
+    }
+
+    // Status will be the same for whatever flags we get back and if it is a
+    // pending relationship.
+    // We'll only have 1 record returned.
+    $relationship = array_shift($records);
+
+    if ($relationship->status == 0 || $relationship->status == 1) {
+      // the users are friends
+      return FLAG_FRIEND_BOTH;
+    }
+    elseif ($relationship->status == 4 && $relationship->entity_id == $uid) {
+      // the logged in user was flagged by another user
+      return FLAG_FRIEND_APPROVAL;
+    }
+    elseif ($relationship->status == 4 && $relationship->entity_id == $entity_id) {
+      // the logged in user flagged another user
+      return FLAG_FRIEND_PENDING;
     }
   }
-  return $status_cache[$key1][$key2];
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
 function flag_friend_form_flag_confirm_alter(&$form, &$form_state) {
-  if ($form['flag_name']['#value'] == 'friend') {
+  if ($form['#flag']->name == 'friend') {
     $action = $form['action']['#value'];
     $flag = flag_get_flag('friend');
-    $content_id = $form['content_id']['#value'];
+    $entity_id = $form['entity_id']['#value'];
     $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : '';
 
     switch ($action) {
       case 'flag':
-        $flag_form = flag_friend_message_form($action, $flag, $content_id, $token);
+        $flag_form = flag_friend_message_form($action, $flag, $entity_id, $token);
         $form = array_merge($form, $flag_form);
         unset($form['actions']['submit']);
         unset($form['actions']['cancel']);
@@ -465,10 +662,10 @@ function flag_friend_form_flag_confirm_alter(&$form, &$form_state) {
         break;
       case 'unflag':
       case 'unfriend':
-        $unflag_form = flag_friend_unfriend_form($action, $flag, $content_id, $token);
+        $unflag_form = flag_friend_unfriend_form($action, $flag, $entity_id, $token);
         $form = array_merge($form, $unflag_form);
         $form['#submit'][] = 'flag_friend_form_submit';
-        // switch the order in which we submit so the fcid can still be found
+        // switch the order in which we submit so the flagging_id can still be found
         $form['#submit'] = array_reverse($form['#submit']);
         break;
     }
@@ -478,9 +675,9 @@ function flag_friend_form_flag_confirm_alter(&$form, &$form_state) {
 /**
  * Form to send a message to a user before friend flagging.
  */
-function flag_friend_message_form($action, $flag, $content_id, $token) {
+function flag_friend_message_form($action, $flag, $entity_id, $token) {
   $form['current'] = array('#type' => 'value', '#value' => func_get_args());
-  $name = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $content_id))->fetchField();
+  $name = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $entity_id))->fetchField();
   $form['flag_friend_message'] = array(
     '#type' => 'textarea',
     '#title' => t('Send @name a message (optional)', array('@name' => $name)),
@@ -488,7 +685,7 @@ function flag_friend_message_form($action, $flag, $content_id, $token) {
     '#cols' => 60,
     '#rows' => 5,
   );
-  $cancel = array_key_exists('destination', $_GET) ? $_GET['destination'] : 'user/' . $content_id;
+  $cancel = array_key_exists('destination', $_GET) ? $_GET['destination'] : 'user/' . $entity_id;
   $form['flag_friend_submit'] = array(
     '#type' => 'submit',
     '#value' => t('Send'),
@@ -501,11 +698,11 @@ function flag_friend_message_form($action, $flag, $content_id, $token) {
 /**
  * Form to confirm an unfriend flagging.
  */
-function flag_friend_unfriend_form($action, $flag, $content_id, $token) {
+function flag_friend_unfriend_form($action, $flag, $entity_id, $token) {
   global $user;
   $form['current'] = array('#type' => 'value', '#value' => func_get_args());
 
-  $status = flag_friend_determine_friend_status($flag, $user->uid, $content_id);
+  $status = flag_friend_determine_friend_status($flag, $entity_id, $user->uid);
   switch ($status) {
     case FLAG_FRIEND_PENDING:
       // pending
@@ -517,10 +714,10 @@ function flag_friend_unfriend_form($action, $flag, $content_id, $token) {
       break;
     default:
       // unfriend
-      $question = $flag->get_label('unflag_confirmation', $content_id);
+      $question = $flag->get_label('unflag_confirmation', $entity_id);
       break;
   }
-  $cancel = array_key_exists('destination', $_GET) ? $_GET['destination'] : 'user/' . $content_id;
+  $cancel = array_key_exists('destination', $_GET) ? $_GET['destination'] : 'user/' . $entity_id;
   $form = confirm_form($form, $question, $cancel);
   $form['#theme'] = 'flag_friend_unfriend_form';
   return $form;
@@ -535,27 +732,28 @@ function flag_friend_form_submit($form, &$form_state) {
   global $user;
   $action = $form_state['values']['current'][0];
   $flag = $form_state['values']['current'][1];
-  $content_id = $form_state['values']['current'][2];
+  $entity_id = $form_state['values']['current'][2];
   $token = $form_state['values']['current'][3];
-  $status = flag_friend_determine_friend_status($flag, $user->uid, $content_id, TRUE);
+  $status = flag_friend_determine_friend_status($flag, $entity_id, $user->uid, TRUE);
 
   if (isset($form_state['values']['flag_friend_message'])) {
     $flag->friend_message = $form_state['values']['flag_friend_message'];
     // Record message only if user pending request.
     if ($status === FLAG_FRIEND_PENDING) {
-      flag_friend_message($action, $flag, $content_id, $user->uid);
+      flag_friend_message($action, $flag, $entity_id, $user->uid);
     }
-    flag_friend_message_email($status, $flag, $content_id, $user);
-  }
-  // the only time we want to unfriend, is if $status = FLAGGED or APPROVAL
-  elseif ($status === FLAG_FRIEND_FLAGGED || $status === FLAG_FRIEND_APPROVAL) {
-    flag_friend_unfriend($action, $flag, $content_id, $user, $status);
+    flag_friend_message_email($status, $flag, $entity_id, $user);
   }
   elseif ($status === FLAG_FRIEND_PENDING) {
     // Clean message when user cancel own request.
-    flag_friend_message($action, $flag, $content_id, $user->uid);
+    flag_friend_message($action, $flag, $entity_id, $user->uid);
+  }
+  elseif ($status === FLAG_FRIEND_APPROVAL) {
+    $flagging_user = user_load($entity_id);
+    flag($action, $flag->name, $user->uid, $flagging_user);
   }
-  //flag.module doesn't understand 'unfriend'
+
+  // flag.module doesn't understand 'unfriend'
   $form_state['values']['action'] = 'unflag';
 }
 
@@ -566,29 +764,29 @@ function flag_friend_form_submit($form, &$form_state) {
  *   String designator to see what we're doing. (flag, unflag, unfriend)
  * @param $flag_name
  *   The name of the flag, should only be 'friend'.
- * @param $content_id
+ * @param $entity_id
  *   The id of the content we're operating on. (uid)
  * @param $status
  *   Status integer to see where we are in the friend process.
  */
-function flag_friend_unfriend($event, $flag, $content_id, $account, $status) {
+function flag_friend_unfriend($event, $flag, $entity_id, $account, $status) {
   global $user;
 
   // 'Denial' and 'Pending - Cancel?'
   if ($event == 'unflag') {
     if ($status == FLAG_FRIEND_APPROVAL) {
-      // Denial - the content_id is actually the account param in this case
-      $account = user_load($content_id);
+      // Denial - the $entity_id is actually the account param in this case
+      $account = user_load($entity_id);
       // and the $user->uid is actually the content(_id) we're unflagging
-      $content_id = $user->uid;
+      $entity_id = $user->uid;
 
       // Fire trigger
       module_invoke_all('flag_friend', 'deny', $user, $account, $flag);
     }
     // remove any messages
-    flag_friend_message($event, $flag, $content_id, $account->uid);
+    flag_friend_message($event, $flag, $entity_id, $account->uid);
     // unflag
-    $flag->flag($event, $content_id, $account);
+    $flag->flag($event, $entity_id, $account);
   }
   elseif ($event == 'unfriend') {
     // remove the friend relationship
@@ -596,17 +794,17 @@ function flag_friend_unfriend($event, $flag, $content_id, $account, $status) {
       ->condition(db_or()
         ->condition(db_and()
           ->condition('uid', $user->uid)
-          ->condition('friend_uid', $content_id)
+          ->condition('entity_id', $entity_id)
         )
         ->condition(db_and()
-          ->condition('uid', $content_id)
-          ->condition('friend_uid', $user->uid)
+          ->condition('uid', $entity_id)
+          ->condition('entity_id', $user->uid)
         )
       )
     ->execute();
 
-    // Denial - the content_id is actually the account param in this case
-    $account = user_load($content_id);
+    // Denial - the $entity_id is actually the account param in this case
+    $account = user_load($entity_id);
 
     // Fire trigger
     module_invoke_all('flag_friend', 'remove', $account, $user, $flag);
@@ -616,31 +814,31 @@ function flag_friend_unfriend($event, $flag, $content_id, $account, $status) {
 /**
  * API callback function to update our new field.
  */
-function flag_friend_message($action, $flag, $content_id, $account_uid) {
-  $fcid = flag_friend_get_fcid($flag, $content_id, $account_uid);
+function flag_friend_message($action, $flag, $entity_id, $account_uid) {
+  $flagging_id = flag_friend_get_flagging_id($flag, $entity_id, $account_uid);
   if ($action == 'flag' && $flag->friend_message) {
     $id = db_insert('flag_friend_message')
       ->fields(array(
-        'fcid' => $fcid,
+        'flagging_id' => $flagging_id,
         'message' => $flag->friend_message,
       ))
       ->execute();
   }
   elseif ($action == 'unflag') {
     db_delete('flag_friend_message')
-      ->condition('fcid', $fcid)
+      ->condition('flagging_id', $flagging_id)
       ->execute();
   }
 }
 
 /**
- * Retrieves the fcid of a flag.
+ * Retrieves the $flagging_id of a flag.
  *
- * NOTE: hopefully fcid will be passed into the hook_flag() at some point
+ * NOTE: hopefully $flagging_id will be passed into the hook_flag() at some point
  *       at which time will render this function unnecessary.
  */
-function flag_friend_get_fcid($flag, $content_id, $account_uid) {
-  return db_query("SELECT fcid FROM {flag_content} WHERE fid = :fid AND content_type = :content_type AND content_id = :content_id AND uid = :uid", array(':fid' => $flag->fid, ':content_type' => $flag->content_type, ':content_id' => $content_id, ':uid' => $account_uid))->fetchField();
+function flag_friend_get_flagging_id($flag, $entity_id, $account_uid) {
+  return db_query("SELECT flagging_id FROM {flagging} WHERE fid = :fid AND entity_type = :entity_type AND entity_id = :entity_id AND uid = :uid", array(':fid' => $flag->fid, ':entity_type' => $flag->entity_type, ':entity_id' => $entity_id, ':uid' => $account_uid))->fetchField();
 }
 
 /**
@@ -724,7 +922,7 @@ function theme_flag_friend_message_email($variables) {
         '!firstname' => isset($sender->firstname) ? $sender->firstname : $sender->name,
         '!site' => variable_get('site_name', ''),
         '!message' => $flag->friend_message ? t('Message:') . $flag->friend_message : '',
-        '!link' => url('user/' . $sender->uid . '/friends/pending', array('absolute' => TRUE)),
+        '!link' => url('user/' . $sender->uid, array('absolute' => TRUE)),
         ));
       break;
 
@@ -753,9 +951,9 @@ function theme_flag_friend_message_email($variables) {
 /**
  * Retrieve our flag's message.
  */
-function flag_friend_get_message($fcid) {
+function flag_friend_get_message($flagging_id) {
   $flag_friend = FALSE;
-  $result = db_query("SELECT message FROM {flag_friend_message} WHERE fcid = :fcid", array(':fcid' => $fcid))->fetchField();
+  $result = db_query("SELECT message FROM {flag_friend_message} WHERE flagging_id = :flagging_id", array(':flagging_id' => $flagging_id))->fetchField();
   if ($result) {
     $flag_friend = $result;
   }
@@ -802,7 +1000,7 @@ function flag_friend_flag_default_flags() {
   $flags = array();
   // Exported flag: "Friend".
   $flags[] = array(
-    'content_type' => 'user',
+    'entity_type' => 'user',
     'name' => 'friend',
     'title' => 'Friend',
     'global' => '0',
@@ -815,7 +1013,18 @@ function flag_friend_flag_default_flags() {
     'unflag_message' => '',
     'unflag_denied_text' => '',
     'link_type' => 'confirm',
-    'roles' => array(
+    'weight' => 0,
+    'show_on_form' => false,
+    'access_author' => '',
+    'show_contextual_link' => false,
+    'show_on_profile' => 1,
+    'access_uid' => 'others',
+    'flag_confirmation' => 'Are you sure you want to add [user:name] to your list of friends?',
+    'unflag_confirmation' => 'Are you sure you want to remove [user:name] from your list of friends?',
+    'module' => 'flag_friend',
+    'api_version' => 3,
+    'status' => false,
+    'import_roles' => array(
       'flag' => array(
         0 => '2',
       ),
@@ -823,11 +1032,6 @@ function flag_friend_flag_default_flags() {
         0 => '2',
       ),
     ),
-    'show_on_profile' => 1,
-    'access_uid' => 'others',
-    'flag_confirmation' => 'Are you sure you want to add [user:name] to your list of friends?',
-    'unflag_confirmation' => 'Are you sure you want to remove [user:name] from your list of friends?',
-    'api_version' => 2,
   );
   return $flags;
 }
@@ -997,7 +1201,7 @@ function flag_friend_preprocess_author_pane(&$variables) {
   // flag out-of-the-box so I feel it's pretty safe to use this permisssion.
   if ($account_id != 0 && user_access('access user profiles') && $user->uid != $account_id) {
     $flag = flag_get_flag('friend');
-    $flag_status = flag_friend_determine_friend_status($flag, $user->uid, $account_id);
+    $flag_status = flag_friend_determine_friend_status($flag, $account_id, $user->uid);
 
     switch ($flag_status) {
       case (FLAG_FRIEND_FLAGGED):
@@ -1041,7 +1245,6 @@ function flag_friend_preprocess_author_pane(&$variables) {
   }
 }
 
-
 /**
  * Implements hook_ctools_plugin_directory().
  */
diff --git a/flag_friend.test b/flag_friend.test
index 647b252..e6f1aa7 100644
--- a/flag_friend.test
+++ b/flag_friend.test
@@ -6,10 +6,10 @@
  */
 
 class FlagFriendUserTestCase extends DrupalWebTestCase {
-  protected $admin_user;
-  protected $user_a;
-  protected $user_b;
-  protected $user_c;
+  var $admin_user;
+  var $user_a;
+  var $user_b;
+  var $user_c;
 
   public static function getInfo() {
     return array(
@@ -135,7 +135,7 @@ class FlagFriendUserTestCase extends DrupalWebTestCase {
     $this->drupalGet('user/' . $this->user_c->uid);
     $this->assertText(t('Add friend'));
     // User A unfriends User B.
-    $this->drupalPost('flag/confirm/unfriend/friend/' . $this->user_b->uid, array(), t('Confirm'));
+    $this->drupalPost('flag/confirm/unflag/friend/' . $this->user_b->uid, array(), t('Confirm'));
     // Verify that User B is no longer a friend of User A.
     $this->drupalGet('user/' . $this->user_b->uid);
     $this->assertText(t('Add friend'));
@@ -179,20 +179,22 @@ class FlagFriendViewsTestCase extends FlagFriendUserTestCase {
     $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
     // Show awaiting approvals. Should only be User C.
-    $this->drupalGet('user/' . $this->user_a->uid . '/friends/flagged');
+    $this->drupalGet('user/' . $this->user_a->uid . '/friends/pending');
     $this->assertText($this->user_c->name);
     $this->assertText(t('Friend Requested. Cancel?'));
     $this->assertNoText($this->user_b->name);
     // Show friend requests. Should be nobody.
-    $this->drupalGet('user/' . $this->user_a->uid . '/friends/pending');
+    $this->drupalGet('user/' . $this->user_a->uid . '/friends/flagged');
     $this->assertNoText($this->user_b->name);
     $this->assertNoText($this->user_c->name);
     // Show User B's friend list. Should only be User A.
+    $this->drupalLogin($this->user_b);
     $this->drupalGet('user/' . $this->user_b->uid . '/friends');
     $this->assertText($this->user_a->name);
-    $this->assertNoText(t('Remove friend'));
+    $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
     // Show User C's friend list. Should be nobody.
+    $this->drupalLogin($this->user_c);
     $this->drupalGet('user/' . $this->user_c->uid . '/friends');
     $this->assertNoText($this->user_a->name);
     $this->assertNoText($this->user_b->name);
@@ -205,21 +207,23 @@ class FlagFriendViewsTestCase extends FlagFriendUserTestCase {
     $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
     // Show awaiting approvals. Should be nobody.
-    $this->drupalGet('user/' . $this->user_b->uid . '/friends/flagged');
+    $this->drupalGet('user/' . $this->user_b->uid . '/friends/pending');
     $this->assertNoText($this->user_c->name);
     $this->assertNoText($this->user_a->name);
     // Show friend requests. Should only be User C.
-    $this->drupalGet('user/' . $this->user_b->uid . '/friends/pending');
+    $this->drupalGet('user/' . $this->user_b->uid . '/friends/flagged');
     $this->assertText($this->user_c->name);
     $this->assertText(t('Approve'));
     $this->assertText(t('Deny'));
     $this->assertNoText($this->user_a->name);
     // Show User A's friend list. Should only be User B.
+    $this->drupalLogin($this->user_a);
     $this->drupalGet('user/' . $this->user_a->uid . '/friends');
     $this->assertText($this->user_b->name);
-    $this->assertNoText(t('Remove friend'));
+    $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
     // Show User C's friend list. Should be nobody.
+    $this->drupalLogin($this->user_c);
     $this->drupalGet('user/' . $this->user_c->uid . '/friends');
     $this->assertNoText($this->user_a->name);
     $this->assertNoText($this->user_b->name);
@@ -231,25 +235,27 @@ class FlagFriendViewsTestCase extends FlagFriendUserTestCase {
     $this->assertNoText($this->user_a->name);
     $this->assertNoText($this->user_b->name);
     // Show awaiting approvals. Should only be User B.
-    $this->drupalGet('user/' . $this->user_c->uid . '/friends/flagged');
+    $this->drupalGet('user/' . $this->user_c->uid . '/friends/pending');
     $this->assertText($this->user_b->name);
     $this->assertText(t('Friend Requested. Cancel?'));
     $this->assertNoText($this->user_a->name);
     // Show friend requests. Should only be User A.
-    $this->drupalGet('user/' . $this->user_c->uid . '/friends/pending');
+    $this->drupalGet('user/' . $this->user_c->uid . '/friends/flagged');
     $this->assertText($this->user_a->name);
     $this->assertText(t('Approve'));
     $this->assertText(t('Deny'));
     $this->assertNoText($this->user_b->name);
     // Show User A's friend list. Should only be User B.
+    $this->drupalLogin($this->user_a);
     $this->drupalGet('user/' . $this->user_a->uid . '/friends');
     $this->assertText($this->user_b->name);
-    $this->assertNoText(t('Remove friend'));
+    $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
     // Show User B's friend list. Should only be User A.
+    $this->drupalLogin($this->user_b);
     $this->drupalGet('user/' . $this->user_b->uid . '/friends');
     $this->assertText($this->user_a->name);
-    $this->assertNoText(t('Remove friend'));
+    $this->assertText(t('Remove friend'));
     $this->assertNoText($this->user_c->name);
   }
 }
diff --git a/includes/flag_friend.views.inc b/includes/flag_friend.views.inc
index 90c61ba..6348f6b 100644
--- a/includes/flag_friend.views.inc
+++ b/includes/flag_friend.views.inc
@@ -6,28 +6,6 @@
  */
 
 /**
- * Implements hook_views_handlers().
- */
-function flag_friend_views_handlers() {
-  return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'flag_friend') . '/includes',
-    ),
-    'handlers' => array(
-      'flag_friend_handler_argument_numeric' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-      'flag_friend_handler_argument_apachesolr_friend' => array(
-        'parent' => 'apachesolr_views_handler_argument',
-      ),
-      'flag_friend_handler_field_links' => array(
-        'parent' => 'views_handler_field',
-      ),
-    ),
-  );
-}
-
-/**
  * Implements hook_views_data().
  */
 function flag_friend_views_data() {
@@ -35,29 +13,36 @@ function flag_friend_views_data() {
 
   // flag_friend table
   $data['flag_friend']['table']['group'] = t('Flag friend');
-  $data['flag_friend']['table']['join'] = array(
-    'users' => array(
-      'left_field' => 'uid',
-      'field' => 'uid',
-    ),
+
+  $data['flag_friend']['table']['join']['flagging'] = array(
+    'left_field' => 'flagging_id',
+    'field' => 'flagging_id',
+    'type' => 'INNER',
   );
 
-  $data['flag_friend']['uid'] = array(
-    'group' => t('Flag friend'),
-    'title' => t('Flag friend links'),
-    'help' => t('Remove/Deny links'),
-    'real field' => 'uid',
+  $data['flag_friend']['status'] = array(
+    'title' => t('Relationship Status'),
+    'help' => t('Display the status of the relationship, whether pending or approved'),
     'field' => array(
-      'handler' => 'flag_friend_handler_field_links',
+      'handler' => 'flag_friend_views_handler_field_status',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'flag_friend_views_handler_filter_status',
     ),
   );
 
-  // argument
-  $data['flag_friend']['friend_uid'] = array(
-    'title' => t('Friends of'),
-    'help' => t('Retrieve the friends of the user id given.'),
-    'argument' => array(
-      'handler' => 'flag_friend_handler_argument_numeric',
+  $data['flag_friend']['friend_link'] = array(
+    'title' => t('Friend Link'),
+    'help' => t('Flag Friend Link. Only used for creating links for users who have been flagged as by a friend'),
+    'field' => array(
+      'handler' => 'flag_friend_views_handler_field_links',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_user_current',
     ),
   );
 
@@ -79,7 +64,7 @@ function flag_friend_views_data() {
       'handler' => 'views_handler_argument_date',
     ),
   );
-
+/*
   // flag_friend_message table
   $data['flag_friend_message']['table']['group'] = t('Flag friend');
   $data['flag_friend_message']['table']['join'] = array(
@@ -97,7 +82,7 @@ function flag_friend_views_data() {
       'handler' => 'views_handler_field',
       'click sortable' => FALSE,
     ),
-  );
+  );*/
 
   // Add the flag relationship.
   // This basically just changes the 'base field' while reusing Flag's
@@ -111,8 +96,8 @@ function flag_friend_views_data() {
       'flag type' => 'user',
       'handler' => 'flag_handler_relationship_content',
       'label' => t('flag friend'),
-      'base' => 'flag_content',
-      'base field' => 'uid',
+      'base' => 'flagging',
+      'base field' => 'entity_id',
       'relationship field' => 'uid',
     ),
   );
@@ -135,3 +120,18 @@ function flag_friend_views_data_alter(&$data) {
     );
   }
 }
+
+/**
+ * Implements hook_views_plugins
+ */
+function flag_friend_views_plugins() {
+  return array(
+    'access' => array(
+      'flag_friend' => array(
+        'title' => t('Restrict Flag Friend Pending and Requests Access'),
+        'help' => t('Creates a custom access check to see if a user is looking at their own account.'),
+        'handler' => 'flag_friend_plugin_access_pending_requested',
+      ),
+    ),
+  );
+}
\ No newline at end of file
diff --git a/includes/flag_friend.views_default.inc b/includes/flag_friend.views_default.inc
index fe783a8..7a6c936 100644
--- a/includes/flag_friend.views_default.inc
+++ b/includes/flag_friend.views_default.inc
@@ -10,336 +10,297 @@
  * Implements hook_views_default_views().
  */
 function flag_friend_views_default_views() {
-  $view = new view;
+  $view = new view();
   $view->name = 'friends';
-  $view->description = 'Various page displays for flag_friend.';
-  $view->tag = 'flag.friend';
+  $view->description = 'Flag Friend Default Views';
+  $view->tag = 'default';
   $view->base_table = 'users';
-  $view->human_name = '';
-  $view->api_version = '3.0-alpha1';
+  $view->human_name = 'Friends';
+  $view->core = 7;
+  $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
 
-  /* Display: Defaults */
-  $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->display->display_options['access']['type'] = 'perm';
+  /* Display: Master */
+  $handler = $view->new_display('default', 'Master', 'default');
+  $handler->display->display_options['title'] = 'Friends';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'flag_friend';
   $handler->display->display_options['cache']['type'] = 'none';
   $handler->display->display_options['query']['type'] = 'views_query';
-  $handler->display->display_options['query']['options']['distinct'] = TRUE;
   $handler->display->display_options['exposed_form']['type'] = 'basic';
   $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '10';
   $handler->display->display_options['style_plugin'] = 'table';
   $handler->display->display_options['style_options']['columns'] = array(
+    'name' => 'name',
     'picture' => 'picture',
-    'name' => 'picture',
-    'message' => 'message',
-    'ops' => 'ops',
-    'uid' => 'ops',
   );
   $handler->display->display_options['style_options']['default'] = '-1';
   $handler->display->display_options['style_options']['info'] = array(
-    'picture' => array(
-      'sortable' => 0,
-      'separator' => '',
-    ),
     'name' => array(
       'sortable' => 0,
+      'default_sort_order' => 'asc',
+      'align' => '',
       'separator' => '',
+      'empty_column' => 0,
     ),
-    'message' => array(
-      'separator' => '',
-    ),
-    'ops' => array(
-      'separator' => '',
-    ),
-    'uid' => array(
+    'picture' => array(
+      'sortable' => 0,
+      'default_sort_order' => 'asc',
+      'align' => '',
       'separator' => '',
+      'empty_column' => 0,
     ),
   );
-  $handler->display->display_options['style_options']['override'] = 1;
-  $handler->display->display_options['style_options']['sticky'] = 0;
-  /* Empty text: Global: Text area */
-  $handler->display->display_options['empty']['text']['id'] = 'area';
-  $handler->display->display_options['empty']['text']['table'] = 'views';
-  $handler->display->display_options['empty']['text']['field'] = 'area';
-  $handler->display->display_options['empty']['text']['empty'] = FALSE;
-  $handler->display->display_options['empty']['text']['content'] = 'No Friends have been added.';
-  $handler->display->display_options['empty']['text']['format'] = '1';
-  /* Relationship: Flag Friend: friend */
-  $handler->display->display_options['relationships']['flag_friend_content_rel']['id'] = 'flag_friend_content_rel';
-  $handler->display->display_options['relationships']['flag_friend_content_rel']['table'] = 'users';
-  $handler->display->display_options['relationships']['flag_friend_content_rel']['field'] = 'flag_friend_content_rel';
-  $handler->display->display_options['relationships']['flag_friend_content_rel']['flag'] = 'friend';
-  $handler->display->display_options['relationships']['flag_friend_content_rel']['user_scope'] = 'any';
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['area']['id'] = 'area';
+  $handler->display->display_options['empty']['area']['table'] = 'views';
+  $handler->display->display_options['empty']['area']['field'] = 'area';
+  $handler->display->display_options['empty']['area']['empty'] = TRUE;
+  $handler->display->display_options['empty']['area']['content'] = 'No friends have been added.';
+  $handler->display->display_options['empty']['area']['format'] = 'filtered_html';
+  /* Relationship: Flags: friend */
+  $handler->display->display_options['relationships']['flag_content_rel']['id'] = 'flag_content_rel';
+  $handler->display->display_options['relationships']['flag_content_rel']['table'] = 'users';
+  $handler->display->display_options['relationships']['flag_content_rel']['field'] = 'flag_content_rel';
+  $handler->display->display_options['relationships']['flag_content_rel']['flag'] = 'friend';
+  /* Field: User: Picture */
+  $handler->display->display_options['fields']['picture']['id'] = 'picture';
+  $handler->display->display_options['fields']['picture']['table'] = 'users';
+  $handler->display->display_options['fields']['picture']['field'] = 'picture';
+  $handler->display->display_options['fields']['picture']['label'] = '';
+  $handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
   /* Field: User: Name */
   $handler->display->display_options['fields']['name']['id'] = 'name';
   $handler->display->display_options['fields']['name']['table'] = 'users';
   $handler->display->display_options['fields']['name']['field'] = 'name';
-  $handler->display->display_options['fields']['name']['link_to_user'] = 1;
+  $handler->display->display_options['fields']['name']['relationship'] = 'uid';
+  $handler->display->display_options['fields']['name']['label'] = 'Requester';
+  $handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
+  $handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
+  $handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
   /* Field: Flags: Flag link */
   $handler->display->display_options['fields']['ops']['id'] = 'ops';
-  $handler->display->display_options['fields']['ops']['table'] = 'flag_content';
+  $handler->display->display_options['fields']['ops']['table'] = 'flagging';
   $handler->display->display_options['fields']['ops']['field'] = 'ops';
-  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_friend_content_rel';
-  /* Field: Flag friend: Flag friend links */
-  $handler->display->display_options['fields']['uid']['id'] = 'uid';
-  $handler->display->display_options['fields']['uid']['table'] = 'flag_friend';
-  $handler->display->display_options['fields']['uid']['field'] = 'uid';
-  /* Argument: Flag friend: Friends of */
-  $handler->display->display_options['arguments']['friend_uid']['id'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['table'] = 'flag_friend';
-  $handler->display->display_options['arguments']['friend_uid']['field'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['style_plugin'] = 'default_summary';
-  $handler->display->display_options['arguments']['friend_uid']['default_argument_type'] = 'fixed';
-  /* Filter: User: Active */
+  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_content_rel';
+  /* Sort criterion: User: Created date */
+  $handler->display->display_options['sorts']['created']['id'] = 'created';
+  $handler->display->display_options['sorts']['created']['table'] = 'users';
+  $handler->display->display_options['sorts']['created']['field'] = 'created';
+  $handler->display->display_options['sorts']['created']['order'] = 'DESC';
+  /* Filter criterion: User: Active */
   $handler->display->display_options['filters']['status']['id'] = 'status';
   $handler->display->display_options['filters']['status']['table'] = 'users';
   $handler->display->display_options['filters']['status']['field'] = 'status';
   $handler->display->display_options['filters']['status']['value'] = '1';
+  $handler->display->display_options['filters']['status']['group'] = 1;
   $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+  /* Filter criterion: Flag friend: Relationship Status */
+  $handler->display->display_options['filters']['status_1']['id'] = 'status_1';
+  $handler->display->display_options['filters']['status_1']['table'] = 'flag_friend';
+  $handler->display->display_options['filters']['status_1']['field'] = 'status';
+  $handler->display->display_options['filters']['status_1']['relationship'] = 'flag_content_rel';
+  $handler->display->display_options['filters']['status_1']['value'] = '1';
 
-  /* Display: Page (friends) */
-  $handler = $view->new_display('page', 'Page (friends)', 'page_1');
-  $handler->display->display_options['defaults']['title'] = FALSE;
-  $handler->display->display_options['title'] = 'Friends';
-  $handler->display->display_options['defaults']['relationships'] = FALSE;
+  /* Display: Page: All Friends */
+  $handler = $view->new_display('page', 'Page: All Friends', 'page');
+  $handler->display->display_options['display_description'] = 'Listing of all approved friends';
   $handler->display->display_options['defaults']['fields'] = FALSE;
   /* Field: User: Picture */
   $handler->display->display_options['fields']['picture']['id'] = 'picture';
   $handler->display->display_options['fields']['picture']['table'] = 'users';
   $handler->display->display_options['fields']['picture']['field'] = 'picture';
-  $handler->display->display_options['fields']['picture']['label'] = 'Friend';
+  $handler->display->display_options['fields']['picture']['label'] = '';
+  $handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
   /* Field: User: Name */
   $handler->display->display_options['fields']['name']['id'] = 'name';
   $handler->display->display_options['fields']['name']['table'] = 'users';
   $handler->display->display_options['fields']['name']['field'] = 'name';
-  $handler->display->display_options['fields']['name']['link_to_user'] = 1;
-  /* Field: Flag friend: Flag friend links */
-  $handler->display->display_options['fields']['uid']['id'] = 'uid';
-  $handler->display->display_options['fields']['uid']['table'] = 'flag_friend';
-  $handler->display->display_options['fields']['uid']['field'] = 'uid';
-  $handler->display->display_options['fields']['uid']['label'] = 'Actions';
-  $handler->display->display_options['defaults']['arguments'] = FALSE;
-  /* Argument: Flag friend: Friends of */
-  $handler->display->display_options['arguments']['friend_uid']['id'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['table'] = 'flag_friend';
-  $handler->display->display_options['arguments']['friend_uid']['field'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['default_action'] = 'default';
-  $handler->display->display_options['arguments']['friend_uid']['style_plugin'] = 'default_summary';
-  $handler->display->display_options['arguments']['friend_uid']['default_argument_type'] = 'user';
-  $handler->display->display_options['arguments']['friend_uid']['default_argument_options']['user'] = FALSE;
-  $handler->display->display_options['arguments']['friend_uid']['break_phrase'] = 0;
-  $handler->display->display_options['arguments']['friend_uid']['not'] = 0;
+  $handler->display->display_options['fields']['name']['label'] = 'User';
+  $handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
+  $handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
+  /* Field: Flags: Flag link */
+  $handler->display->display_options['fields']['ops']['id'] = 'ops';
+  $handler->display->display_options['fields']['ops']['table'] = 'flagging';
+  $handler->display->display_options['fields']['ops']['field'] = 'ops';
+  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_content_rel';
   $handler->display->display_options['path'] = 'user/%/friends/all';
   $handler->display->display_options['menu']['type'] = 'default tab';
   $handler->display->display_options['menu']['title'] = 'View All Friends';
+  $handler->display->display_options['menu']['description'] = 'View all of your friends';
   $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['name'] = 'user-menu';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
   $handler->display->display_options['tab_options']['type'] = 'tab';
   $handler->display->display_options['tab_options']['title'] = 'Friends';
   $handler->display->display_options['tab_options']['weight'] = '0';
 
-  /* Display: Page (pending) */
-  $handler = $view->new_display('page', 'Page (pending)', 'page_2');
+  /* Display: Page: Pending Friends */
+  $handler = $view->new_display('page', 'Page: Pending Friends', 'page_1');
   $handler->display->display_options['defaults']['title'] = FALSE;
-  $handler->display->display_options['title'] = 'Friend Requests';
-  $handler->display->display_options['defaults']['header'] = FALSE;
-  /* Header: Global: Text area */
-  $handler->display->display_options['header']['text']['id'] = 'area';
-  $handler->display->display_options['header']['text']['table'] = 'views';
-  $handler->display->display_options['header']['text']['field'] = 'area';
-  $handler->display->display_options['header']['text']['empty'] = FALSE;
-  $handler->display->display_options['header']['text']['content'] = 'These are users who would like to be your friend.';
-  $handler->display->display_options['header']['text']['format'] = '1';
+  $handler->display->display_options['title'] = 'Pending Friends';
+  $handler->display->display_options['display_description'] = 'List of all pending friend relationships';
+  $handler->display->display_options['defaults']['access'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'flag_friend';
   $handler->display->display_options['defaults']['empty'] = FALSE;
-  /* Empty text: Global: Text area */
-  $handler->display->display_options['empty']['text']['id'] = 'area';
-  $handler->display->display_options['empty']['text']['table'] = 'views';
-  $handler->display->display_options['empty']['text']['field'] = 'area';
-  $handler->display->display_options['empty']['text']['empty'] = FALSE;
-  $handler->display->display_options['empty']['text']['content'] = 'No Friend Requests.';
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['area']['id'] = 'area';
+  $handler->display->display_options['empty']['area']['table'] = 'views';
+  $handler->display->display_options['empty']['area']['field'] = 'area';
+  $handler->display->display_options['empty']['area']['empty'] = TRUE;
+  $handler->display->display_options['empty']['area']['content'] = 'No pending friends.';
+  $handler->display->display_options['empty']['area']['format'] = 'filtered_html';
   $handler->display->display_options['defaults']['fields'] = FALSE;
   /* Field: User: Picture */
   $handler->display->display_options['fields']['picture']['id'] = 'picture';
   $handler->display->display_options['fields']['picture']['table'] = 'users';
   $handler->display->display_options['fields']['picture']['field'] = 'picture';
-  $handler->display->display_options['fields']['picture']['label'] = 'User';
+  $handler->display->display_options['fields']['picture']['label'] = '';
+  $handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
   /* Field: User: Name */
   $handler->display->display_options['fields']['name']['id'] = 'name';
   $handler->display->display_options['fields']['name']['table'] = 'users';
   $handler->display->display_options['fields']['name']['field'] = 'name';
-  $handler->display->display_options['fields']['name']['link_to_user'] = 1;
-  /* Field: Flag friend: Message */
-  $handler->display->display_options['fields']['message']['id'] = 'message';
-  $handler->display->display_options['fields']['message']['table'] = 'flag_friend_message';
-  $handler->display->display_options['fields']['message']['field'] = 'message';
-  $handler->display->display_options['fields']['message']['relationship'] = 'flag_friend_content_rel';
+  $handler->display->display_options['fields']['name']['label'] = 'User';
+  $handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
+  $handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
   /* Field: Flags: Flag link */
   $handler->display->display_options['fields']['ops']['id'] = 'ops';
-  $handler->display->display_options['fields']['ops']['table'] = 'flag_content';
+  $handler->display->display_options['fields']['ops']['table'] = 'flagging';
   $handler->display->display_options['fields']['ops']['field'] = 'ops';
-  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_friend_content_rel';
-  $handler->display->display_options['fields']['ops']['label'] = 'Actions';
-  /* Field: Flag friend: Flag friend links */
-  $handler->display->display_options['fields']['uid']['id'] = 'uid';
-  $handler->display->display_options['fields']['uid']['table'] = 'flag_friend';
-  $handler->display->display_options['fields']['uid']['field'] = 'uid';
-  $handler->display->display_options['defaults']['arguments'] = FALSE;
-  /* Argument: Flags: Content ID */
-  $handler->display->display_options['arguments']['content_id']['id'] = 'content_id';
-  $handler->display->display_options['arguments']['content_id']['table'] = 'flag_content';
-  $handler->display->display_options['arguments']['content_id']['field'] = 'content_id';
-  $handler->display->display_options['arguments']['content_id']['relationship'] = 'flag_friend_content_rel';
-  $handler->display->display_options['arguments']['content_id']['default_action'] = 'default';
-  $handler->display->display_options['arguments']['content_id']['style_plugin'] = 'default_summary';
-  $handler->display->display_options['arguments']['content_id']['default_argument_type'] = 'user';
-  $handler->display->display_options['arguments']['content_id']['default_argument_options']['user'] = FALSE;
-  $handler->display->display_options['arguments']['content_id']['validate_type'] = 'php';
-  $handler->display->display_options['arguments']['content_id']['validate_options']['code'] = 'if ($argument !== $GLOBALS[\'user\']->uid && !user_access(\'administer users\')) {
-                                        return FALSE;
-                                      }
-                                      return TRUE;';
-  $handler->display->display_options['arguments']['content_id']['break_phrase'] = 0;
-  $handler->display->display_options['arguments']['content_id']['not'] = 0;
+  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_content_rel';
+  $handler->display->display_options['defaults']['filter_groups'] = FALSE;
+  $handler->display->display_options['defaults']['filters'] = FALSE;
+  /* Filter criterion: User: Active */
+  $handler->display->display_options['filters']['status']['id'] = 'status';
+  $handler->display->display_options['filters']['status']['table'] = 'users';
+  $handler->display->display_options['filters']['status']['field'] = 'status';
+  $handler->display->display_options['filters']['status']['value'] = '1';
+  $handler->display->display_options['filters']['status']['group'] = 1;
+  $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+  /* Filter criterion: Flag friend: Relationship Status */
+  $handler->display->display_options['filters']['status_1']['id'] = 'status_1';
+  $handler->display->display_options['filters']['status_1']['table'] = 'flag_friend';
+  $handler->display->display_options['filters']['status_1']['field'] = 'status';
+  $handler->display->display_options['filters']['status_1']['relationship'] = 'flag_content_rel';
+  $handler->display->display_options['filters']['status_1']['value'] = '4';
   $handler->display->display_options['path'] = 'user/%/friends/pending';
   $handler->display->display_options['menu']['type'] = 'tab';
-  $handler->display->display_options['menu']['title'] = 'Friend Requests';
+  $handler->display->display_options['menu']['title'] = 'Pending Friends';
+  $handler->display->display_options['menu']['description'] = 'Pending Friend Requests';
   $handler->display->display_options['menu']['weight'] = '0';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
 
-  /* Display: Page (flagged) */
-  $handler = $view->new_display('page', 'Page (flagged)', 'page_3');
+  /* Display: Page: Friend Requests */
+  $handler = $view->new_display('page', 'Page: Friend Requests', 'page_2');
   $handler->display->display_options['defaults']['title'] = FALSE;
-  $handler->display->display_options['title'] = 'Awaiting Friend Approvals';
-  $handler->display->display_options['defaults']['header'] = FALSE;
-  /* Header: Global: Text area */
-  $handler->display->display_options['header']['text']['id'] = 'area';
-  $handler->display->display_options['header']['text']['table'] = 'views';
-  $handler->display->display_options['header']['text']['field'] = 'area';
-  $handler->display->display_options['header']['text']['empty'] = TRUE;
-  $handler->display->display_options['header']['text']['content'] = 'These are users who you have requested to be friends with.';
-  $handler->display->display_options['header']['text']['format'] = '1';
+  $handler->display->display_options['title'] = 'Friend Requests';
+  $handler->display->display_options['display_description'] = 'Friends flagged by the current user';
+  $handler->display->display_options['defaults']['access'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'flag_friend';
   $handler->display->display_options['defaults']['empty'] = FALSE;
-  /* Empty text: Global: Text area */
-  $handler->display->display_options['empty']['text']['id'] = 'area';
-  $handler->display->display_options['empty']['text']['table'] = 'views';
-  $handler->display->display_options['empty']['text']['field'] = 'area';
-  $handler->display->display_options['empty']['text']['empty'] = FALSE;
-  $handler->display->display_options['empty']['text']['content'] = 'No Friend Requests.';
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['area']['id'] = 'area';
+  $handler->display->display_options['empty']['area']['table'] = 'views';
+  $handler->display->display_options['empty']['area']['field'] = 'area';
+  $handler->display->display_options['empty']['area']['empty'] = TRUE;
+  $handler->display->display_options['empty']['area']['content'] = 'No friend requests.';
+  $handler->display->display_options['empty']['area']['format'] = 'filtered_html';
   $handler->display->display_options['defaults']['relationships'] = FALSE;
-  /* Relationship: Flags: friend */
-  $handler->display->display_options['relationships']['flag_content_rel']['id'] = 'flag_content_rel';
-  $handler->display->display_options['relationships']['flag_content_rel']['table'] = 'users';
-  $handler->display->display_options['relationships']['flag_content_rel']['field'] = 'flag_content_rel';
-  $handler->display->display_options['relationships']['flag_content_rel']['flag'] = 'friend';
-  $handler->display->display_options['relationships']['flag_content_rel']['user_scope'] = 'any';
+  /* Relationship: Flags: User's flagged content */
+  $handler->display->display_options['relationships']['flag_user_content_rel']['id'] = 'flag_user_content_rel';
+  $handler->display->display_options['relationships']['flag_user_content_rel']['table'] = 'users';
+  $handler->display->display_options['relationships']['flag_user_content_rel']['field'] = 'flag_user_content_rel';
+  $handler->display->display_options['relationships']['flag_user_content_rel']['flag'] = 'friend';
   /* Relationship: Flags: User */
   $handler->display->display_options['relationships']['uid']['id'] = 'uid';
-  $handler->display->display_options['relationships']['uid']['table'] = 'flag_content';
+  $handler->display->display_options['relationships']['uid']['table'] = 'flagging';
   $handler->display->display_options['relationships']['uid']['field'] = 'uid';
-  $handler->display->display_options['relationships']['uid']['relationship'] = 'flag_content_rel';
-  $handler->display->display_options['relationships']['uid']['required'] = 0;
+  $handler->display->display_options['relationships']['uid']['relationship'] = 'flag_user_content_rel';
   $handler->display->display_options['defaults']['fields'] = FALSE;
-  /* Field: User: Picture */
-  $handler->display->display_options['fields']['picture']['id'] = 'picture';
-  $handler->display->display_options['fields']['picture']['table'] = 'users';
-  $handler->display->display_options['fields']['picture']['field'] = 'picture';
-  $handler->display->display_options['fields']['picture']['label'] = 'User';
   /* Field: User: Name */
   $handler->display->display_options['fields']['name']['id'] = 'name';
   $handler->display->display_options['fields']['name']['table'] = 'users';
   $handler->display->display_options['fields']['name']['field'] = 'name';
-  $handler->display->display_options['fields']['name']['link_to_user'] = 1;
-  /* Field: Flag friend: Message */
-  $handler->display->display_options['fields']['message']['id'] = 'message';
-  $handler->display->display_options['fields']['message']['table'] = 'flag_friend_message';
-  $handler->display->display_options['fields']['message']['field'] = 'message';
-  $handler->display->display_options['fields']['message']['relationship'] = 'flag_content_rel';
-  /* Field: Flags: Flag link */
-  $handler->display->display_options['fields']['ops']['id'] = 'ops';
-  $handler->display->display_options['fields']['ops']['table'] = 'flag_content';
-  $handler->display->display_options['fields']['ops']['field'] = 'ops';
-  $handler->display->display_options['fields']['ops']['relationship'] = 'flag_content_rel';
-  $handler->display->display_options['fields']['ops']['label'] = 'Actions';
+  /* Field: User: Picture */
+  $handler->display->display_options['fields']['picture']['id'] = 'picture';
+  $handler->display->display_options['fields']['picture']['table'] = 'users';
+  $handler->display->display_options['fields']['picture']['field'] = 'picture';
+  /* Field: Flag friend: Friend Link */
+  $handler->display->display_options['fields']['friend_link']['id'] = 'friend_link';
+  $handler->display->display_options['fields']['friend_link']['table'] = 'flag_friend';
+  $handler->display->display_options['fields']['friend_link']['field'] = 'friend_link';
+  $handler->display->display_options['fields']['friend_link']['relationship'] = 'flag_user_content_rel';
   $handler->display->display_options['defaults']['arguments'] = FALSE;
-  /* Argument: User: Uid */
-  $handler->display->display_options['arguments']['uid']['id'] = 'uid';
-  $handler->display->display_options['arguments']['uid']['table'] = 'users';
-  $handler->display->display_options['arguments']['uid']['field'] = 'uid';
-  $handler->display->display_options['arguments']['uid']['relationship'] = 'uid';
-  $handler->display->display_options['arguments']['uid']['default_action'] = 'default';
-  $handler->display->display_options['arguments']['uid']['style_plugin'] = 'default_summary';
-  $handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
-  $handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
-  $handler->display->display_options['arguments']['uid']['validate_type'] = 'php';
-  $handler->display->display_options['arguments']['uid']['validate_options']['code'] = 'if ($argument !== $GLOBALS[\'user\']->uid && !user_access(\'administer users\')) {
-      return FALSE;
-    }
-    return TRUE;';
-  $handler->display->display_options['arguments']['uid']['break_phrase'] = 0;
-  $handler->display->display_options['arguments']['uid']['not'] = 0;
+  /* Contextual filter: Flags: Content ID */
+  $handler->display->display_options['arguments']['entity_id']['id'] = 'entity_id';
+  $handler->display->display_options['arguments']['entity_id']['table'] = 'flagging';
+  $handler->display->display_options['arguments']['entity_id']['field'] = 'entity_id';
+  $handler->display->display_options['arguments']['entity_id']['relationship'] = 'flag_user_content_rel';
+  $handler->display->display_options['arguments']['entity_id']['default_action'] = 'not found';
+  $handler->display->display_options['arguments']['entity_id']['default_argument_type'] = 'fixed';
+  $handler->display->display_options['arguments']['entity_id']['summary']['number_of_records'] = '0';
+  $handler->display->display_options['arguments']['entity_id']['summary']['format'] = 'default_summary';
+  $handler->display->display_options['arguments']['entity_id']['summary_options']['items_per_page'] = '25';
+  $handler->display->display_options['arguments']['entity_id']['validate']['type'] = 'php';
+  $handler->display->display_options['arguments']['entity_id']['validate_options']['code'] = 'global $user;
+  if ($user->uid == $handler->argument) {
+  return TRUE;
+  } else {
+  return FALSE;
+  }';
+  $handler->display->display_options['arguments']['entity_id']['validate']['fail'] = 'access denied';
+  $handler->display->display_options['defaults']['filter_groups'] = FALSE;
+  $handler->display->display_options['defaults']['filters'] = FALSE;
+  /* Filter criterion: User: Active */
+  $handler->display->display_options['filters']['status']['id'] = 'status';
+  $handler->display->display_options['filters']['status']['table'] = 'users';
+  $handler->display->display_options['filters']['status']['field'] = 'status';
+  $handler->display->display_options['filters']['status']['value'] = '1';
+  $handler->display->display_options['filters']['status']['group'] = 1;
+  $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+  /* Filter criterion: Flag friend: Relationship Status */
+  $handler->display->display_options['filters']['status_1']['id'] = 'status_1';
+  $handler->display->display_options['filters']['status_1']['table'] = 'flag_friend';
+  $handler->display->display_options['filters']['status_1']['field'] = 'status';
+  $handler->display->display_options['filters']['status_1']['relationship'] = 'flag_user_content_rel';
+  $handler->display->display_options['filters']['status_1']['value'] = '4';
   $handler->display->display_options['path'] = 'user/%/friends/flagged';
   $handler->display->display_options['menu']['type'] = 'tab';
-  $handler->display->display_options['menu']['title'] = 'Awaiting Friend Approvals';
-  $handler->display->display_options['menu']['weight'] = '0';
+  $handler->display->display_options['menu']['title'] = 'Friend Requests';
+  $handler->display->display_options['menu']['description'] = 'Friends you have flagged';
+  $handler->display->display_options['menu']['weight'] = '10';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
 
-  /* Display: Current user's Friends block */
-  $handler = $view->new_display('block', 'Current user\'s Friends block', 'block_1');
-  $handler->display->display_options['defaults']['items_per_page'] = FALSE;
-  $handler->display->display_options['defaults']['use_more'] = FALSE;
-  $handler->display->display_options['use_more'] = TRUE;
-  $handler->display->display_options['defaults']['relationships'] = FALSE;
+  /* Display: Block: Friends */
+  $handler = $view->new_display('block', 'Block: Friends', 'block_1');
+  $handler->display->display_options['defaults']['pager'] = FALSE;
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '5';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
   $handler->display->display_options['defaults']['fields'] = FALSE;
+  /* Field: User: Picture */
+  $handler->display->display_options['fields']['picture']['id'] = 'picture';
+  $handler->display->display_options['fields']['picture']['table'] = 'users';
+  $handler->display->display_options['fields']['picture']['field'] = 'picture';
+  $handler->display->display_options['fields']['picture']['label'] = '';
+  $handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
   /* Field: User: Name */
   $handler->display->display_options['fields']['name']['id'] = 'name';
   $handler->display->display_options['fields']['name']['table'] = 'users';
   $handler->display->display_options['fields']['name']['field'] = 'name';
-  $handler->display->display_options['fields']['name']['link_to_user'] = 1;
-  /* Field: Flag friend: Flag friend links */
-  $handler->display->display_options['fields']['uid']['id'] = 'uid';
-  $handler->display->display_options['fields']['uid']['table'] = 'flag_friend';
-  $handler->display->display_options['fields']['uid']['field'] = 'uid';
-  $handler->display->display_options['defaults']['arguments'] = FALSE;
-  /* Argument: Flag friend: Friends of */
-  $handler->display->display_options['arguments']['friend_uid']['id'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['table'] = 'flag_friend';
-  $handler->display->display_options['arguments']['friend_uid']['field'] = 'friend_uid';
-  $handler->display->display_options['arguments']['friend_uid']['default_action'] = 'default';
-  $handler->display->display_options['arguments']['friend_uid']['style_plugin'] = 'default_summary';
-  $handler->display->display_options['arguments']['friend_uid']['default_argument_type'] = 'current_user';
-  $handler->display->display_options['arguments']['friend_uid']['break_phrase'] = 0;
-  $handler->display->display_options['arguments']['friend_uid']['not'] = 0;
-  $translatables['friends'] = array(
-    t('Defaults'),
-    t('more'),
-    t('Apply'),
-    t('Reset'),
-    t('Sort By'),
-    t('Asc'),
-    t('Desc'),
-    t('Items per page'),
-    t('- All -'),
-    t('Offset'),
-    t('No Friends have been added.'),
-    t('flag friend'),
-    t('Name'),
-    t('Flag link'),
-    t('Flag friend links'),
-    t('All'),
-    t('Page (friends)'),
-    t('Friends'),
-    t('Friend'),
-    t('Actions'),
-    t('Page (pending)'),
-    t('Friend Requests'),
-    t('These are users who would like to be your friend.'),
-    t('No Friend Requests.'),
-    t('User'),
-    t('Message'),
-    t('Page (flagged)'),
-    t('Awaiting Friend Approvals'),
-    t('These are users who you have requested to be friends with.'),
-    t('flag'),
-    t('Flag user'),
-    t('Current user\'s Friends block'),
-  );
+  $handler->display->display_options['fields']['name']['relationship'] = 'uid';
+  $handler->display->display_options['fields']['name']['label'] = 'Requester';
+  $handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
+  $handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
+  $handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
+  $handler->display->display_options['block_description'] = 'Flag Friend Friends';
   $views[$view->name] = $view;
   return $views;
 }
diff --git a/includes/flag_friend_handler_argument_numeric.inc b/includes/flag_friend_handler_argument_numeric.inc
deleted file mode 100644
index 12ab63c..0000000
--- a/includes/flag_friend_handler_argument_numeric.inc
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the custom argument handler for the flag_friend table.
- */
-
-/**
- * Provides a view argument handler.
- *
- * @ingroup views
- */
-class flag_friend_handler_argument_numeric extends views_handler_argument_numeric {
-  function option_definition() {
-    $options = parent::option_definition();
-    $options['flag_friend_include_arg_user'] = array(
-      'default' => 0,
-      'translatable' => FALSE,
-    );
-    return $options;
-  }
-
-  function options_form(&$form, &$form_state) {
-    parent::options_form($form, $form_state);
-    $options = $this->options;
-    $form['flag_friend_include_arg_user'] = array(
-      '#title' => t('Include argument user'),
-      '#description' => t('Include results from the user whose friends will be shown.'),
-      '#type' => 'checkbox',
-      '#default_value' => $options['flag_friend_include_arg_user'],
-    );
-  }
-
-  function query($group_by = FALSE) {
-    if (!empty($this->options['break_phrase'])) {
-      views_break_phrase($this->argument, $this);
-    }
-    else {
-      $this->value = array((int) $this->argument);
-    }
-
-    //Determine operator
-    $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
-
-    //Detect  if $value is array or not
-    if (is_array($this->value)) {
-      $value = $this->value;
-    }
-    else {
-      $value = array($this->argument);
-    }
-
-    //Build array of all friends
-    $all_friends = array();
-    $all_friends_of = array();
-    $all_friends += db_select('flag_friend', 'f')->fields('f', array('friend_uid'))->condition('uid', $value, $operator)->execute()->fetchCol();
-    $all_friends_of += db_select('flag_friend', 'f')->fields('f', array('uid'))->condition('friend_uid', $value, $operator)->execute()->fetchCol();
-
-    $all_friends = array_merge($all_friends, $all_friends_of);
-
-    //Include argument if option is set.
-    if ($this->options['flag_friend_include_arg_user']) {
-      $all_friends[] = (int) $this->argument;
-    }
-
-    //If no friends, pass something or SQL borks
-    if (count($all_friends) === 0) {
-      $all_friends = array(0);
-    }
-
-    //Determine field
-    if ($this->view->base_table != 'users') {
-      $field .= 'users_' . $this->view->base_table;
-    }
-    else {
-      $field = 'users';
-    }
-
-    $this->query->add_where(0, $field . ".uid", $all_friends);
-  }
-}
diff --git a/includes/flag_friend_handler_field_links.inc b/includes/flag_friend_handler_field_links.inc
deleted file mode 100644
index 8b2f324..0000000
--- a/includes/flag_friend_handler_field_links.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the flag friend Ops field handler.
- */
-
-/**
- * Views field handler for the Flag friend operations links (remove/pending/approve/deny).
- *
- * @ingroup views
- */
-class flag_friend_handler_field_links extends views_handler_field {
-  function render($values) {
-    global $user;
-    $flag = flag_get_flag('friend');
-    $content_id = $values->uid;
-    // what's the status?
-    $status = flag_friend_determine_friend_status($flag, $user->uid, $content_id);
-    $link_type = ($status == FLAG_FRIEND_APPROVAL) ? 'unflag' : 'unfriend';
-    if ($this->view->args[0] == $user->uid) {
-      return flag_friend_create_link($link_type, $content_id);
-    }
-  }
-}
diff --git a/includes/flag_friend_plugin_access_pending_requested.inc b/includes/flag_friend_plugin_access_pending_requested.inc
new file mode 100644
index 0000000..6a980d2
--- /dev/null
+++ b/includes/flag_friend_plugin_access_pending_requested.inc
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @file
+ * Definition of flag_friend_views_plugin_access_pending_requested.
+ */
+
+/**
+ * @see hook_views_plugins()
+ */
+
+class flag_friend_plugin_access_pending_requested extends views_plugin_access {
+  function access($account) {
+    return flag_friend_views_access();
+  }
+
+  function get_access_callback() {
+    return array('flag_friend_views_access');
+  }
+}
\ No newline at end of file
diff --git a/includes/flag_friend_views_handler_field_links.inc b/includes/flag_friend_views_handler_field_links.inc
new file mode 100644
index 0000000..fa26495
--- /dev/null
+++ b/includes/flag_friend_views_handler_field_links.inc
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Contains the flag friend Ops field handler.
+ */
+
+/**
+ * Views field handler for the Flag friend operations link when a user has requested
+ * to be the friend of the logged in user.
+ *
+ * From flag_friend.module
+ * FLAG_FRIEND_BOTH 0 - Users are friends
+ * FLAG_FRIEND_FLAGGED 1 - Users are friends
+ * FLAG_FRIEND_UNFLAGGED 2 - Neither user is flagged as a friend
+ * FLAG_FRIEND_APPROVAL 3 - User has been flagged, pending their approval
+ * FLAG_FRIEND_PENDING 4 - 1 user has flagged the other user
+ *
+ * @ingroup views
+ */
+class flag_friend_views_handler_field_links extends flag_handler_field_ops {
+  function render($values) {
+    global $user;
+    $flag = flag_get_flag('friend');
+    $entity_id = $values->uid;
+    // what's the status?
+    $status = flag_friend_determine_friend_status($flag, $entity_id, $user->uid);
+
+    $link = NULL;
+    if ($status == FLAG_FRIEND_APPROVAL) {
+      // flagged, waiting for your approval
+      $link = $flag->theme('flag', $entity_id);
+      $link .= str_replace(t('Approve'), t('Deny'), $flag->theme('unflag', $entity_id));
+    }
+    elseif ($status == FLAG_FRIEND_PENDING) {
+      // flagged, waiting for their approval
+      $link = $flag->theme('unflag', $entity_id);
+    }
+    elseif ($status == FLAG_FRIEND_UNFLAGGED) {
+      // not friends
+      $link = $flag->theme('flag', $entity_id);
+    }
+    elseif ($status == FLAG_FRIEND_FLAGGED || $status == FLAG_FRIEND_BOTH) {
+      // friends
+      $link = $flag->theme('unflag', $entity_id);
+    }
+    return $link;
+  }
+}
diff --git a/includes/flag_friend_views_handler_field_status.inc b/includes/flag_friend_views_handler_field_status.inc
new file mode 100644
index 0000000..e606e05
--- /dev/null
+++ b/includes/flag_friend_views_handler_field_status.inc
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @file
+ * Definition of flag_friend_views_handler_field.
+ */
+
+/**
+ * A handler to render the appropriate relationship name as defined by
+ * the user.
+ *
+ * From flag_friend.module
+ * FLAG_FRIEND_BOTH 0 - Users are friends
+ * FLAG_FRIEND_FLAGGED 1 - Users are friends
+ * FLAG_FRIEND_UNFLAGGED 2 - Neither user is flagged as a friend
+ * FLAG_FRIEND_APPROVAL 3 - User has been flagged, pending their approval
+ * FLAG_FRIEND_PENDING 4 - 1 user has flagged the other user
+ *
+ * @ingroup views_field_handlers
+ */
+class flag_friend_views_handler_field_status extends views_handler_field {
+
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['friends'] = array('default' => 'Friends');
+    $options['not_friends'] = array('default' => 'Not friends');
+    $options['pending_approval'] = array('default' => 'Pending Approval');
+    $options['pending_requests'] = array('default' => 'Pending Requests');
+
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['friends'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Approved relationship name',
+      '#default_value' => $this->options['friends'],
+    );
+
+    $form['not_friends'] = array(
+      '#type' => 'textfield',
+      '#title' => 'No relationship name',
+      '#default_value' => $this->options['not_friends'],
+    );
+
+    $form['pending_approval'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Pending approval name',
+      '#default_value' => $this->options['pending_approval'],
+    );
+
+    $form['pending_requests'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Pending requests name',
+      '#default_value' => $this->options['pending_requests'],
+    );
+
+    parent::options_form($form, $form_state);
+  }
+
+  function render($values) {
+    global $user;
+    $flag = flag_get_flag('friend');
+    $entity_id = $values->uid;
+    $status = flag_friend_determine_friend_status($flag, $entity_id, $user->uid);
+
+    switch ($status) {
+      case '0' :
+      case '1' :
+        return check_plain($this->options['friends']);
+        break;
+      case '2' :
+        return check_plain($this->options['not_friends']);
+        break;
+      case '3' :
+        return check_plain($this->options['pending_approval']);
+        break;
+      case '4' :
+        return check_plain($this->options['pending_requests']);
+        break;
+    }
+  }
+}
\ No newline at end of file
diff --git a/includes/flag_friend_views_handler_filter_status.inc b/includes/flag_friend_views_handler_filter_status.inc
new file mode 100644
index 0000000..4b807e2
--- /dev/null
+++ b/includes/flag_friend_views_handler_filter_status.inc
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @file
+ * Definition of flag_friend_views_handler_filter_status.
+ */
+
+/**
+ * Filter friends based on relationship status
+ *
+ * From flag_friend.module
+ * FLAG_FRIEND_BOTH 0 - Users are friends
+ * FLAG_FRIEND_FLAGGED 1 - Users are friends
+ * FLAG_FRIEND_UNFLAGGED 2 - Neither user is flagged as a friend
+ * FLAG_FRIEND_APPROVAL 3 - User has been flagged, pending their approval
+ * FLAG_FRIEND_PENDING 4 - 1 user has flagged the other user
+ *
+ * @ingroup views_filter_handlers
+ */
+class flag_friend_views_handler_filter_status extends views_handler_filter {
+  function option_definition() {
+    $options = parent::option_definition();
+    unset($options['value']);
+    $options['value']['default'] = 1;
+    return $options;
+  }
+
+  function value_form(&$form, &$form_state) {
+    parent::value_form($form, $form_state);
+    $form['value'] = array(
+      '#type' => 'radios',
+      '#title' => t('Relationship Status'),
+      '#options' => array(
+        '1' => t('Friends'),
+        '2' => t('Not Friends'),
+        '4' => t('Pending Friends'),
+      ),
+      '#default_value' => !empty($this->value['type']) ? $this->value['type'] : 1,
+    );
+  }
+}
\ No newline at end of file
