diff --git a/addtocalendar.module b/addtocalendar.module
old mode 100644
new mode 100755
index 3eb1998..12cd2d4
--- a/addtocalendar.module
+++ b/addtocalendar.module
@@ -92,7 +92,7 @@ function addtocalendar_field_formatter_settings_form_alter(&$settings_form, $con
       'atc_location' => t('Location'),
       'atc_organizer' => t('Organizer'),
       'atc_organizer_email' => t('Organizer email'),
-      'atc_date_end' => t('End Date'),
+      'atc_date_end' => t('Date Field'),
     );
     foreach ($info as $id => $label) {
       $settings_form['addtocalendar_settings'][$id]['field'] = array(
@@ -174,7 +174,6 @@ function addtocalendar_preprocess_field(&$variables) {
   // Provide an extra variable to the field template when the field uses
   // a formatter of type 'foo_formatter'.
   if ($variables['element']['#formatter'] == 'date_default') {
-    // dsm($variables);
     $entity_type = $variables['element']['#entity_type'];
     $field_name  = $variables['element']['#field_name'];
     $bundle      = $variables['element']['#bundle'];
@@ -190,7 +189,7 @@ function addtocalendar_preprocess_field(&$variables) {
       $settings = $variables['addtocalendar_settings'];
       if ($formatter_settings['addtocalendar_show']) {
         $timeZone = date_default_timezone_get();
-        $date = format_date(strtotime($variables['element']['#object']->field_date['und'][0]['value']), 'custom', 'm/d/Y g:ia');
+        $date = format_date(strtotime($variables['element']['#object']->{$settings['atc_date_end']['field']}['und'][0]['value']), 'custom', 'm/d/Y g:ia');
         $build['addtocalendar']['atc_date_start'] = array(
           '#type' => 'html_tag',
           '#tag' => 'var',
@@ -222,7 +221,11 @@ function addtocalendar_preprocess_field(&$variables) {
             default:
               $field = $settings[$value]['field'];
               $field_data = field_get_items($entity_type, $entity, $field);
-              $class_value = $field_data[0]['value'];
+              if ($value == 'atc_date_end') {
+                  $class_value = isset($field_data[0]['value2']) ? $field_data[0]['value2'] : $field_data[0]['value'];
+              } else {
+                  $class_value = $field_data[0]['value'];
+              }
               break;
           }
 
