diff --git a/scheduler.module b/scheduler.module
index f58f201..62dca4a 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -1,4 +1,10 @@
 <?php
+
+/**
+ * @file
+ * Scheduler publishes and unpublishes nodes on dates specified by the user.
+ */
+
 define('SCHEDULER_DATE_FORMAT', 'Y-m-d H:i:s');
 
 /**
@@ -107,18 +113,24 @@ function scheduler_help($section) {
   $output = '';
   switch ($section) {
     case 'admin/config/content/scheduler':
-      $output = '<p>' . t('Some scheduler actions are set for each different content type. These are accessed via the <a href="@link">admin content type</a> list.', array('@link' => url('admin/structure/types'))) . '<br/>' . t('The options and settings below are common to all content types.') . '</p>';
+      $output = '<p>' . t('Some Scheduler options are set for each different content type, and are accessed via the <a href="@link">admin content type</a> list.', array('@link' => url('admin/structure/types'))) . '</br>';
+      $output .= t('The options and settings below are common to all content types.') . '</p>';
       break;
 
     case 'admin/config/content/scheduler/cron':
       $base_url = $GLOBALS['base_url'];
-      $output = '<p>' . t("When you have set up Drupal's standard crontab job cron.php then Scheduler will be executed during each cron run. " . "However, if you would like finer granularity to scheduler, but don't want to run Drupal's cron more often then you can use the " . "lightweight cron handler provided by Scheduler. This is an independent cron job which only runs the scheduler process and does not " . "execute any cron tasks defined by Drupal core or any other modules."
-      ) . '</p>' . '<p>' . t("Scheduler's cron is at /scheduler/cron and a sample crontab entry to run scheduler every minute might look like:") . '</p>' . '<code>* * * * * wget -q -O /dev/null "' . $base_url . '/scheduler/cron"</code>' . '<p>' . t('or') . '</p>' . '<code>* * * * * curl -s -o /dev/null "' . $base_url . '/scheduler/cron"</code><br/><br/>';
+      $output = '<p>' . t("When you have set up Drupal's standard crontab job cron.php then Scheduler will be executed during each cron run. However, if you would like finer granularity to scheduler, but don't want to run Drupal's cron more often then you can use the lightweight cron handler provided by Scheduler. This is an independent cron job which only runs the scheduler process and does not execute any cron tasks defined by Drupal core or any other modules.") . '</p>';
+      $output .= '<p>' . t("Scheduler's cron is at /scheduler/cron and a sample crontab entry to run scheduler every minute might look like:") . '</p>';
+      $output .= '<code>* * * * * wget -q -O /dev/null "' . $base_url . '/scheduler/cron"</code>';
+      $output .= '<p>' . t('or') . '</p>';
+      $output .= '<code>* * * * * curl -s -o /dev/null "' . $base_url . '/scheduler/cron"</code><br/><br/>';
       break;
 
     case 'admin/help#scheduler':
       // This is shown at the top of admin/help/scheduler.
-      $output = '<p>' . t('The Scheduler module provides the functionality for automatic publishing and unpublishing of nodes at specified future dates.') . '</p>' . '<p>' . t('You can read more in the <a href="@readme">readme.txt</a> file.', array('@readme' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'scheduler') . '/README.txt')) . '</p>';
+      $output = '<h3>' . t('About') . '</h3>';
+      $output .= '<p>' . t('The Scheduler module provides the functionality for automatic publishing and unpublishing of nodes at specified future dates.') . '</p>';
+      $output .= '<p>' . t('You can read more in the <a href="@readme">readme.txt</a> file.', array('@readme' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'scheduler') . '/README.txt')) . '</p>';
       break;
 
     default:
@@ -127,14 +139,8 @@ function scheduler_help($section) {
 }
 
 /**
- * Implements hook_ctools_plugin_directory().
+ * Return the main admin form for configuring Scheduler.
  */
-function scheduler_ctools_plugin_directory($owner, $plugin_type) {
-  if ($owner == 'ctools' && $plugin_type == 'content_types') {
-    return 'plugins/content_types';
-  }
-}
-
 function scheduler_admin() {
   $form['scheduler_date_format'] = array(
     '#type' => 'textfield',
@@ -182,9 +188,9 @@ function scheduler_admin_validate($form, &$form_state) {
   $form_state['values']['scheduler_date_format'] = trim(preg_replace('/\s+/', ' ', $form_state['values']['scheduler_date_format']));
 
   if ($form_state['values']['scheduler_field_type'] == 'date_popup') {
-    $format      = $form_state['values']['scheduler_date_format'];
+    $format = $form_state['values']['scheduler_date_format'];
     $time_format = date_limit_format($format, array('hour', 'minute', 'second'));
-    $acceptable  = date_popup_time_formats();
+    $acceptable = date_popup_time_formats();
 
     if (!in_array($time_format, $acceptable)) {
       form_set_error('scheduler_date_format', t('The Date Popup module only accepts the following formats: !formats', array('!formats' => implode($acceptable, ', '))));
@@ -404,7 +410,7 @@ function scheduler_form_alter(&$form, $form_state) {
   }
 }
 
-/*
+/**
  * Displays a list of nodes that are scheduled for (un)publication. This will
  * appear as a tab on the content admin page ('admin/content').
  */
@@ -522,7 +528,7 @@ function _scheduler_strtotime($str) {
  * @see date()
  */
 function _scheduler_strptime($date, $format) {
-  # we need to build a regex pattern for the date format
+  // Build a regex pattern for the date format.
   $date_entities = array('d', 'H', 'h', 'm', 'i', 'a', 'A', 's', 'y', 'Y', 'n', 'j', 'g', 'G');
   $date_regex_replacements = array('(\d{2})', '(\d{2})', '(\d{2})', '(\d{2})', '(\d{2})', '([ap]m)', '([AP]M)', '(\d{2})', '(\d{2})', '(\d{4})', '(\d{1,2})', '(\d{1,2})', '(\d{1,2})', '(\d{1,2})');
   $custom_pattern = str_replace($date_entities, $date_regex_replacements, $format);
@@ -625,6 +631,9 @@ function scheduler_node_view($node, $view_mode = 'full', $langcode) {
   }
 }
 
+/**
+ * Implements hook_node_validate().
+ */
 function scheduler_node_validate($node, $form) {
   // adjust the entered times for timezone consideration.
   // Note, we must check to see if the value is numeric,
@@ -663,6 +672,9 @@ function scheduler_node_validate($node, $form) {
   }
 }
 
+/**
+ * Implements hook_node_presave().
+ */
 function scheduler_node_presave($node) {
   foreach (array('publish_on', 'unpublish_on') as $key) {
     if (empty($node->$key)) {
@@ -682,6 +694,9 @@ function scheduler_node_presave($node) {
   }
 }
 
+/**
+ * Implements hook_node_insert().
+ */
 function scheduler_node_insert($node) {
   // only insert into database if we need to (un)publish this node at some date
   if (!empty($node->publish_on) || !empty($node->unpublish_on)) {
@@ -693,6 +708,9 @@ function scheduler_node_insert($node) {
   }
 }
 
+/**
+ * Implements hook_node_update().
+ */
 function scheduler_node_update($node) {
   // only update database if we need to (un)publish this node at some date
   // otherwise the user probably cleared out the (un)publish dates so we should remove the record
@@ -707,6 +725,9 @@ function scheduler_node_update($node) {
   }
 }
 
+/**
+ * Implements hook_node_delete().
+ */
 function scheduler_node_delete($node) {
   db_delete('scheduler')->condition('nid', $node->nid)->execute();
 }
@@ -761,9 +782,9 @@ function _scheduler_publish() {
   $query->condition('s.publish_on', 0, '>');
   $query->condition('s.publish_on', REQUEST_TIME, '<');
   //  $query_result = db_query('SELECT s.nid AS nid FROM {scheduler} s LEFT JOIN {node} n ON s.nid = n.nid WHERE n.status = 0 AND s.publish_on > 0 AND s.publish_on < :now ', array(':now' => REQUEST_TIME));
-  $queryResult = $query->execute();
+  $query_result = $query->execute();
   $nids = array();
-  while ($node = $queryResult->fetchObject()) {
+  while ($node = $query_result->fetchObject()) {
     $nids[] = $node->nid;
   }
 
@@ -774,8 +795,8 @@ function _scheduler_publish() {
   drupal_alter('scheduler_nid_list', $nids, $action);
 
   foreach ($nids as $nid) {
-    $n                 = node_load($nid);
-    $n->changed        = $n->publish_on;
+    $n = node_load($nid);
+    $n->changed = $n->publish_on;
     $old_creation_date = $n->created;
     if (variable_get('scheduler_publish_touch_' . $n->type, 0) == 1) {
       $n->created = $n->publish_on;
@@ -835,9 +856,9 @@ function _scheduler_unpublish() {
   $query->addJoin('LEFT', 'node', 'n', 's.nid = n.nid');
   $query->condition('s.unpublish_on', 0, '>');
   $query->condition('s.unpublish_on', REQUEST_TIME, '<');
-  $queryResult = $query->execute();
+  $query_result = $query->execute();
   $nids = array();
-  while ($node = $queryResult->fetchObject()) {
+  while ($node = $query_result->fetchObject()) {
     $nids[] = $node->nid;
   }
 
@@ -850,9 +871,9 @@ function _scheduler_unpublish() {
   foreach ($nids as $nid) {
     // If this node is to be unpublished, we can update the node and remove the
     // record since it cannot be republished.
-    $n               = node_load($nid);
+    $n = node_load($nid);
     $old_change_date = $n->changed;
-    $n->changed      = $n->unpublish_on;
+    $n->changed = $n->unpublish_on;
 
     if ($n->status == 1) {
       $create_unpublishing_revision = variable_get('scheduler_unpublish_revision_' . $n->type, 0) == 1;
@@ -917,6 +938,13 @@ function scheduler_theme() {
   );
 }
 
+/**
+ * Run the lightweight cron.
+ *
+ * The Scheduler part of the processing performed here is the same as in the
+ * normal Drupal cron run. The difference is that only scheduler_cron() is
+ * executed, no other modules hook_cron() functions are called.
+ */
 function _scheduler_run_cron() {
   $log = variable_get('scheduler_lightweight_log', 1);
   if ($log) {
@@ -930,11 +958,11 @@ function _scheduler_run_cron() {
     }
   }
   if ($log) {
-    watchdog('scheduler', 'Lightweight cron run completed', array(), WATCHDOG_NOTICE, l('settings', 'admin/config/content/scheduler'));
+    watchdog('scheduler', 'Lightweight cron run completed', array(), WATCHDOG_NOTICE, l(t('settings'), 'admin/config/content/scheduler/cron'));
   }
 
   // This message is only seen when the lightweight cron is tested interactively.
-  drupal_set_message(t("Scheduler's lightweight cron completed. See !log for details.", array('!log' => l('admin/reports/dblog', 'admin/reports/dblog'))));
+  drupal_set_message(t('Lightweight cron run completed - see <a href="@url">log</a> for details.', array('@url' => url('admin/reports/dblog'))));
 
   // Must return something so that an output page is created if testing the lightweight cron interactively.
   return ' ';
@@ -949,7 +977,7 @@ function _scheduler_lightweight_cron() {
   $form['scheduler_cron'] = array(
     '#type' => 'submit',
     '#prefix' => t("You can test Scheduler's lightweight cron process interactively") . ':<div>',
-    '#value' => t("Run Scheduler's cron now"),
+    '#value' => t("Run Scheduler's lightweight cron now"),
     '#submit' => array('_scheduler_run_cron'),
     '#suffix' => "</div>\n",
   );
@@ -968,12 +996,14 @@ function _scheduler_lightweight_cron() {
 }
 
 /**
- * Scheduler API to perform actions when nodes are (un)published
+ * Scheduler API to perform actions when nodes are (un)published.
+ * This allows other modules to implement hook_scheduler_api($node, $action).
  *
  * @param $node
  *  The node object
  * @param $action
- *  The action being performed, either "publish" or "unpublish"
+ *  The action being performed, either 'pre_publish', 'publish', 'pre_unpublish'
+ *  or 'unpublish'
  */
 function _scheduler_scheduler_api($node, $action) {
   foreach (module_implements('scheduler_api') as $module) {
@@ -982,10 +1012,16 @@ function _scheduler_scheduler_api($node, $action) {
   }
 }
 
+/**
+ * Generate the timecheck admin page.
+ */
 function _scheduler_timecheck() {
   return theme('scheduler_timecheck', array('now' => REQUEST_TIME));
 }
 
+/**
+ * Provide a theme function for the timecheck admin page.
+ */
 function theme_scheduler_timecheck($variables) {
   $now = $variables['now'];
 
@@ -1038,25 +1074,25 @@ function scheduler_preprocess_node(&$variables, $hook) {
 }
 
 /**
- * Implements hook_feeds_node_processor_targets_alter().
- * advertises publish_on and unpublish_on as mappable values to the feeds module
+ * Implements hook_feeds_processor_targets_alter().
  */
 function scheduler_feeds_processor_targets_alter(&$targets, $processor, $content_type) {
-
+  // This function will advertise publish_on and unpublish_on as mappable values
+  // to the feeds module.
   $publishing_enabled = variable_get('scheduler_publish_enable_' . $content_type, 0);
   $unpublishing_enabled = variable_get('scheduler_unpublish_enable_' . $content_type, 0);
 
   if ($publishing_enabled) {
     $targets['publish_on'] = array(
       'name' => t('Scheduler: publish on'),
-      'description' => t('The date, when scheduler module should publish node.'),
+      'description' => t('The date when Scheduler module will publish the node.'),
       'callback' => 'scheduler_set_target',
     );
   }
   if ($unpublishing_enabled) {
     $targets['unpublish_on'] = array(
       'name' => t('Scheduler: unpublish on'),
-      'description' => t('The date, when scheduler module should unpublish node.'),
+      'description' => t('The date when Scheduler module will unpublish the node.'),
       'callback' => 'scheduler_set_target',
     );
   }
@@ -1064,20 +1100,18 @@ function scheduler_feeds_processor_targets_alter(&$targets, $processor, $content
 
 /**
  * Mapping callback for feeds module.
- *
- * This callback converts input from parser and converts it
- * to timestamp form. After that it sets value of correct field of node.
  */
 function scheduler_set_target($source, $node, $target, $value) {
   if (!is_array($value)) {
+    // Convert input from parser to timestamp form.
     if (!is_numeric($value)) {
       $timestamp = strtotime($value);
     }
     else {
       $timestamp = $value;
     }
-    // if strtotime returned correct timestamp, we proceed with
-    // processing. Otherwise do nothing..
+    // If strtotime returned correct timestamp then set the value of the target
+    // field in the node. Otherwise do nothing.
     if (($timestamp !== FALSE) && ($timestamp != -1)) {
       $node->$target = $timestamp;
     }
@@ -1085,9 +1119,22 @@ function scheduler_set_target($source, $node, $target, $value) {
 }
 
 /**
+ * Implements hook_ctools_plugin_directory().
+ */
+function scheduler_ctools_plugin_directory($owner, $plugin_type) {
+ // Declare a form pane (panels content type) for use in ctools and page
+ // manager. This allows the Scheduler fieldset to be placed in a panel.
+  if ($owner == 'ctools' && $plugin_type == 'content_types') {
+    return 'plugins/content_types';
+  }
+}
+
+/**
  * Implements hook_i18n_sync_options().
  */
 function scheduler_i18n_sync_options($entity_type, $bundle_name) {
+  // Keep the scheduler dates synchronised between separate nodes which have
+  // been defined as translations of each other.
   if ($entity_type == 'node') {
     return array(
       'publish_on' => array(
@@ -1103,10 +1150,11 @@ function scheduler_i18n_sync_options($entity_type, $bundle_name) {
 }
 
 /**
- * Implements drupal_alter('field_attach_prepare_translation', $entity, $context).
- * Prefill the node translation form with values from the translation source node.
+ * Implements hook_field_attach_prepare_translation_alter().
  */
 function scheduler_field_attach_prepare_translation_alter($entity, $context) {
+  // Prefill the node translation form with values from the translation source
+  // node.
   $source_entity = $context['source_entity'];
 
   if (isset($source_entity->scheduler['publish_on'])) {
