diff --git a/contrib/fb_registration.module b/contrib/fb_registration.module
index 594f8a44f6aaf1596a4e3a2d579cc8a982b03c81..33de69c4e37099658f5f684000f3d7f077a051d1 100644
--- a/contrib/fb_registration.module
+++ b/contrib/fb_registration.module
@@ -2,11 +2,18 @@
 
 /**
  * @file
- *
  * http://developers.facebook.com/docs/user_registration
  */
 
-
+/**
+ * Modify registration form fields to be compatible with the fb api.
+ *
+ * Modifications are done in-situ, ie. the $form is passed by reference and
+ * there is no return value.
+ *
+ * @param object $form
+ *   A Drupal $form object for the user registration form.
+ */
 function _fb_registration_form_alter_fields(&$form) {
   // name, email and password require special treatment.
   if (isset($form['name'])) {
@@ -15,17 +22,12 @@ function _fb_registration_form_alter_fields(&$form) {
   if (isset($form['mail'])) {
     $form['mail']['#fb_registration_field'] = 'email';
   }
-  /* user_login form needs this
-     $form['pass']['#fb_registration_field'] = array(
-     'name' => 'password',
-     'view' => 'not_prefilled',
-     );
-  */
   if (isset($form['captcha'])) {
     $form['captcha']['#fb_registration_field'] = 'captcha';
   }
 
-  // Because profile module may or may not nest fields in fieldsets, we must recurse.
+  // Because profile module may or may not nest fields in fieldsets,
+  // we must recurse.
   foreach (element_children($form) as $key) {
     _fb_registration_form_alter_fields($form[$key]);
   }
@@ -54,14 +56,14 @@ function fb_registration_form_alter(&$form, &$form_state, $form_id) {
     _fb_registration_form_alter_fields($form);
   }
 
+  // Registration has been enabled for this form.
   if (isset($form['#fb_registration'])) {
-    // Registration has been enabled for this form.
-
     $sr = $GLOBALS['_fb']->getSignedRequest();
+
+    // The form has been submitted.  We don't need to alter it.  Instead we
+    // must submit the original form.
     if ($sr &&
         ($registration = $sr['registration'])) {
-      // The form has been submitted.  We don't need to alter it.  Instead we
-      // must submit the original form.
 
       // Captcha is a special case, we can't require it during drupal_execute.
       $form['captcha'] = NULL;
@@ -70,13 +72,16 @@ function fb_registration_form_alter(&$form, &$form_state, $form_id) {
         $state = array(
           'fb_registration_avoid_recursion' => TRUE,
           'values' => $registration,
-          'fb_regisration_values' => $registration, // un-altered values.
+          // Un-altered values.
+          'fb_regisration_values' => $registration,
         );
 
-        // Drupal expects strings for some values, not the arrays sent by facebook.
+        // Drupal expects strings for some values, not the arrays sent by
+        // facebook.
         foreach ($registration as $key => $value) {
           if (is_array($value) && $value['name']) {
-            $state['values'][$key] = $value['name']; // Simply for drupal form api.
+            // Simply for drupal form api.
+            $state['values'][$key] = $value['name'];
           }
           elseif ($key == 'email' && is_string($value)) {
             // Drupal expects 'mail', not 'email'.
@@ -133,7 +138,9 @@ function fb_registration_form_alter(&$form, &$form_state, $form_id) {
 
 }
 
-
+/**
+ * TODO: Write a great description for this function.
+ */
 function _fb_registration_extract_fb_fields(&$fb_fields, &$form) {
 
   foreach (element_children($form) as $key) {
@@ -147,17 +154,17 @@ function _fb_registration_extract_fb_fields(&$fb_fields, &$form) {
         $field = $form[$key]['#fb_registration_field'];
       }
     }
+    // #fb_registration_field not specified, fallback to the following
+    // code, which translates some drupal form elements into facebook
+    // fields.
     else {
-      // #fb_registration_field not specified, fallback to the following
-      // code, which translates some drupal form elements into facebook
-      // fields.
-
       if (!isset($form[$key]['#type'])) {
         _fb_registration_extract_fb_fields($fb_fields, $form[$key]);
       }
       elseif ($form[$key]['#type'] == 'fieldset') {
         _fb_registration_extract_fb_fields($fb_fields, $form[$key]);
-        $form[$key] = NULL; // So the (now empty?) fieldset will not be rendered.
+        // So the (now empty?) fieldset will not be rendered.
+        $form[$key] = NULL;
       }
       elseif ($form[$key]['#type'] == 'submit') {
         // We have to use the register button provided by facebook.
@@ -170,8 +177,8 @@ function _fb_registration_extract_fb_fields(&$fb_fields, &$form) {
           'description' => $form[$key]['#title'],
         );
       }
+      // Facebook does not offer multi-line text area.  Use single line instead.
       elseif ($form[$key]['#type'] == 'textarea') {
-        // Facebook does not offer multi-line text area.  Use single line instead.
         $field = array(
           'name' => $key,
           'type' => 'text',
@@ -195,15 +202,13 @@ function _fb_registration_extract_fb_fields(&$fb_fields, &$form) {
           'default' => $form[$key]['#default_value'],
         );
       }
-
-
       // @TODO do something intelligent with unknown element types.
     }
     if (count($field)) {
       // Use the facebook field...
       $fb_fields[] = $field;
-      // and not the drupal field.
+      // And not the drupal field.
       $form[$key] = NULL;
     }
   }
-}
\ No newline at end of file
+}
