diff --git a/sharethis/sharethis.module b/sharethis/sharethis.module
index b11b052..f07f8cc 100644
--- a/sharethis/sharethis.module
+++ b/sharethis/sharethis.module
@@ -9,9 +9,9 @@
  *
  * Displays help and module information.
  *
- * @param path
+ * @param path
  *   Which path of the site we're using to display help
- * @param arg
+ * @param arg
  *   Array that holds the current path as returned from arg() function
  */
 function sharethis_help($path, $arg) {
@@ -38,7 +38,7 @@ function sharethis_help($path, $arg) {
 function sharethis_permission() {
   return array(
     'administer sharethis' => array(
-      'title' => t('Administer ShareThis'),
+      'title' => t('Administer ShareThis'),
       'description' => t('Change the settings for how ShareThis behaves on the site.'),
     ),
   );
@@ -59,7 +59,7 @@ function sharethis_configuration_form($form, &$form_state) {
   drupal_add_css($my_path . '/stlib_picker.css');
   $current_options_array = sharethis_get_options_array();
   global $base_url;
-
+
   // Create the variables related to widget choice.
   $widget_type = $current_options_array['widget'];
   $widget_markup = "";
@@ -77,7 +77,7 @@ function sharethis_configuration_form($form, &$form_state) {
     $service_string_markup .= "\"" . $key . "\",";
   }
   $service_string_markup = substr($service_string_markup, 0, -1);
-
+
   // Create an array of node types.
   $node_type_array = node_type_get_types();
   $node_type_options = array();
@@ -91,7 +91,7 @@ function sharethis_configuration_form($form, &$form_state) {
   $publisher = $current_options_array['publisherID'];
   // Create the variables for teasers.
   $teaser = $current_options_array['viewMode'] == "1" ? TRUE : FALSE;
-
+
   $form = array();
   $form['options'] = array(
     '#type' => 'fieldset',
@@ -231,7 +231,7 @@ function sharethis_configuration_form($form, &$form_state) {
  */
 function sharethis_configuration_form_validate($form, &$form_state) {
   //Additional filters for the service option input
-
+
   // Sanitize the publisher ID option.  Since it's a text field, remove anything that resembles code
   $form_state['values']['sharethis_service_option'] = filter_xss($form_state['values']['sharethis_service_option'], array());

@@ -253,7 +253,7 @@ function sharethis_configuration_form_validate($form, &$form_state) {
   // Ensure default value for twitter handle
   $form_state['values']['sharethis_twitter_handle'] = (isset($form_state['values']['sharethis_twitter_handle'])) ? $form_state['values']['sharethis_twitter_handle'] : '';
 }
-
+
  /**
  * Implements hook_menu.
  *
@@ -276,9 +276,9 @@ function sharethis_menu() {
  * Inserts ShareThis widget code onto each node view.
  * TODO: Want to add the option somewhere to select nodes.
  *
- * @param node
+ * @param node
  *   The node that is being acted upon
- * @param view_mode
+ * @param view_mode
  *   The type of view (teaser, full, etc)
  * @param langcode
  *   Information about the language
@@ -293,7 +293,7 @@ function sharethis_node_view($node, $view_mode, $langcode) {
   }
   // First get all of the options for the sharethis widget from the database:
   $data_options = sharethis_get_options_array();
-
+
   // This looks to see if the path variable has been posted by some rewrite module.
   // This is not super efficient, O(N), but N is often less than 20.
   $is_path = FALSE;
@@ -319,12 +319,12 @@ function sharethis_node_view($node, $view_mode, $langcode) {
   // Get the full path to insert into the Share Buttons.
   $mPath = $base_url . $path_module;
   $mTitle = $node->title;
-
+
   // Only display the ShareThis buttons if this node fits all the requirements
   if (strpos($data_options['nodeType'], $node->type) !== FALSE) { // Make sure this is the right type of node.
     if (($data_options['viewMode'] == "1") && ($view_mode == "teaser")) { // If "don't show for teaser" is enabled, and this is a teaser, don't do anything
       // Do nothing.
-    }
+    }
     else {
       // Check where we want to display the ShareThis widget.
       switch (variable_get('sharethis_location', 'content')) {
@@ -333,14 +333,14 @@ function sharethis_node_view($node, $view_mode, $langcode) {
             '#tag' => 'div', // Wrap it in a div.
             '#type' => 'html_tag',
             '#attributes' => array('class' => 'sharethis-buttons'),
-            '#value' => sharethis_get_button_HTML($data_options, $mPath, $mTitle),
+            '#value' => theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle)),
             '#weight' => intval(variable_get('sharethis_weight', 10)),
           );
         break;
         case 'links':
           $links['sharethis'] = array(
             'html' => TRUE,
-            'title' => sharethis_get_button_HTML($data_options, $mPath, $mTitle),
+            'title' => theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle)),
             'attributes' => array('class' => 'sharethis-buttons'),
           );
           $node->content['links']['sharethis'] = array(
@@ -360,6 +360,21 @@ function sharethis_node_view($node, $view_mode, $langcode) {
 }

 /**
+ * Implements hook_theme().
+ */
+function sharethis_theme($existing, $type, $theme, $path) {
+  $theme = array();
+  $theme['sharethis'] = array(
+    'variables' => array(
+      'data_options' => NULL,
+      'm_path' => NULL,
+      'm_title' => NULL,
+    ),
+  );
+  return $theme;
+}
+
+/**
  * sharethisGetOptionArray is a helper function for DB access.
  *
  * Returns options that have been stored in the database.
@@ -382,10 +397,13 @@ function sharethis_get_options_array() {
 }

 /**
- * sharethisGet_button_HTML is the function that creates the ShareThis code
- * It returns the appropriate html based on your settings.
+ * Theme function for ShareThis code based on settings.
  */
-function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {
+function theme_sharethis($variables) {
+  $data_options = $variables['data_options'];
+  $m_path = $variables['m_path'];
+  $m_title = $variables['m_title'];
+
   // Inject the extra services.
   foreach ($data_options['option_extras'] as $service) {
     $data_options['services'] .= ',"' . $service . '"';
@@ -410,10 +428,10 @@ function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {
     $serviceCodeName = substr($service[1], 0, -1);

     // Switch the title on a per-service basis if required.
-    $title = $mTitle;
+    $title = $m_title;
     switch ($serviceCodeName) {
       case 'twitter':
-        $title = empty($data_options['twitter_suffix']) ? $mTitle : check_plain($mTitle) . ' ' . check_plain($data_options['twitter_suffix']);
+        $title = empty($data_options['twitter_suffix']) ? $Title : check_plain($Title) . ' ' . check_plain($data_options['twitter_suffix']);
         break;
     }

@@ -422,7 +440,7 @@ function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {

     // Put together the span attributes.
     $attributes = array(
-      'st_url' => $mPath,
+      'st_url' => $m_path,
       'st_title' => $title,
       'class' => 'st_' . $display . $type,
     );
@@ -506,7 +524,7 @@ function sharethis_block_contents() {
     $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
     $mPath = url($_GET['q'], array('absolute' => TRUE));
     $mTitle = drupal_get_title();
-    return sharethis_get_button_HTML($data_options, $mPath, $mTitle);
+    return theme('sharethis', array($data_options, $mPath, $mTitle));
   }
 }

