diff --git a/uc_webform.module b/uc_webform.module
index 35eb40b..d66e63a 100644
--- a/uc_webform.module
+++ b/uc_webform.module
@@ -1,161 +1,73 @@
 <?php
 
-/***********************************
- * Drupal Hooks
+/**
+ * @file
+ * Provides components to the Webform module utilizing the Ubercart package.
  */
 
-/**
- * Impliments hook_views_api()
+/*
+ * Drupal Hooks
  */
-function uc_webform_views_api() {
-    return array(
-        'api' => 2.0,
-        'path' => drupal_get_path('module', 'uc_webform') . '/views',
-    );
-}
 
 /**
- * Implements hook_menu
+ * Implements hook_menu()
  */
 function uc_webform_menu() {
-    $items = array();
-
-    $items['uc_webform/autocomplete'] = array(
-        'title'             => 'Ubercart Webform autocomplete',
-        'page callback'     => 'uc_webform_autocomplete',
-        'access callback'   => 'user_access',
-        'access arguments'  => array('edit own webform submissions'),
-        'type'              => MENU_CALLBACK,
+  $items = array();
+  /*
+  // In D6 but not brought over initially
+  $items['cart/delete-form'] = array(
+    'title' => 'Delete',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('uc_webform_submission_delete_products_form'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  */
+  $items['uc_webform/autocomplete'] = array(
+    'title'             => 'Ubercart Webform autocomplete',
+    'page callback'     => 'uc_webform_autocomplete',
+    'access callback'   => 'user_access',
+    'access arguments'  => array('edit own webform submissions'),
+    'type'              => MENU_CALLBACK,
+  );
+// Note change in path from D6
+  $items['admin/store/orders/%/webform'] = array(
+      'title'             => 'Webform Results',
+      'page callback'     => 'uc_webform_application',
+      'page arguments'    => array( 3 ),
+      'access arguments'  => array('view all orders'),
+      'type'              => MENU_LOCAL_TASK
     );
-    
- $items['admin/store/orders/%/webform'] = array(
-      'title' => t('Webform Results'),
-      'page callback' => 'uc_webform_application',
-      'page arguments' => array( 3 ),
-      'access arguments' => array('view all orders'),
-      'type' => MENU_LOCAL_TASK
-    );
-    
-    return $items;
-}
-
-function uc_webform_application($oid){
-  $urls = explode('/', $_GET['q']);
-  $webform_order_query = db_query('SELECT * FROM {uc_webform_submission} uc LEFT JOIN {webform_submissions} wc ON uc.sid = wc.sid WHERE order_id = :oid', array(':oid' => $urls[3]));
-  $display = '<ul>';
-  include_once drupal_get_path('module', 'webform').'/includes/webform.submissions.inc';
-  foreach($webform_order_query as $record){
-    // get the result   
-    $display .= '<li>'.l('Webform Results', 'node/'.$record->nid.'/submission/'.$record->sid).'</li>'; // drupal_render(webform_submission_page($webform, $record->sid, 'html')) . '<hr/>';
-  }
-  $display.='</ul>';
-  return $display;
-}
-
 
-/**
- * Implements hook_node_load
- */
-function uc_webform_node_load($nodes, $types) {
-    $result = db_query('SELECT * FROM {uc_webform} WHERE nid IN(:nids)',
-        array(':nids' => array_keys($nodes)));
-    foreach ($result as $record) {
-        if (uc_product_is_product($nodes[$record->nid])) {
-            $nodes[$record->nid]->webform_nid        = $record->webform_nid;
-            $nodes[$record->nid]->uc_webform_submit = $record->submit;
-        }
-    }
-}
-
-/**
- * Implements hook_node_delete
- */
-function uc_webform_node_delete($node) {
-    
-  if (!isset($node->webform_nid) || !isset($node->uc_webform_submit)) return;
-
-    db_delete('uc_webform')
-        ->condition('nid', $node->nid)
-        ->execute();
-}
-
-/** 
- * Implements hook_node_insert
- */
-function uc_webform_node_insert($node) {
-   if( uc_product_is_product($node) ){
-     db_insert('uc_webform')
-        ->fields(
-          array(
-          	'nid' => $node->nid, 
-          	'webform_nid' => $node->webform_nid, 
-          	'submit' => $node->uc_webform_submit
-          )
-          )
-        ->execute();    
-     
-   }
-   
- 
+  return $items;
 }
 
 /**
- * Implements hook_node_update
+ * Implements hook_views_api()
  */
-function uc_webform_node_update($node) {
-    uc_webform_node_delete($node);
-    uc_webform_node_insert($node);
+function uc_webform_views_api() {
+  return array(
+    'api' => 2.0,
+    'path' => drupal_get_path('module', 'uc_webform') . '/views',
+  );
 }
 
-/****************************************
- * Form API 
- */
-
 /**
- * Implements hook_form_FORM_ID_alter
+ * Provides an auto-complete list of products that do not contain attributes.
  */
-function uc_webform_form_node_form_alter(&$form, &$form_state) {
-    if ($form['#node']->type == 'webform') {
-        $form['base']['uc_webform_submit'] = array(
-            '#type'             => 'checkbox',
-            '#title'            => t('Add this webform to cart on submission?'),
-            '#default_value'    => isset($form['#node']->uc_webform_submit) ? $form['#node']->uc_webform_submit : FALSE,
-        );
-        $form['#submit'][] = 'uc_webform_form_node_submit';
-    } 
-    else if( uc_product_is_product($form['#node']) ) {
-        $form['base']['uc_webform'] = array(
-          '#type' => 'feildset',
-          '#title' => t('Webform Settings')
-        );
-        $form['base']['uc_webform']['webform_nid'] = array(
-            '#type'                 => 'textfield',
-            '#title'                => t('Application Form'),
-            '#autocomplete_path'    => 'uc_webform/autocomplete',
-            '#default_value'        => isset($form['#node']->webform_nid) ? $form['#node']->webform_nid : null,
-            '#value_callback'       => 'uc_webform_autocomplete_value',
-            '#element_validate'     => array('uc_webform_autocomplete_validate')
-        );
-        $form['base']['uc_webform']['uc_webform_submit'] = array(
-          '#type' => 'checkbox',
-          '#title' => t('Redirect user to cart after form submission.'),
-          '#default_value' => isset($form['#node']->uc_webform_submit) ? $form['#node']->uc_webform_submit : null
-        );
-    }
-}
-
 function uc_webform_autocomplete($string) {
-    $results = db_select('node', 'n')
-        ->fields('n')
-        ->condition('n.title', '%' . $string . '%', 'LIKE')
-        ->condition('n.type', 'webform')
-        ->range(0, 10)
-        ->execute();
-    foreach ($results as $row) {
-        $matches[$row->title . " [nid:$row->nid]"] = '<div class="reference-autocomplete">' . $row->title . '</div>';    
-    }
+  $results = db_select('node', 'n')
+      ->fields('n')
+      ->condition('n.title', '%' . $string . '%', 'LIKE')
+      ->condition('n.type', 'webform')
+      ->range(0, 10)
+      ->execute();
+  foreach ($results as $row) {
+      $matches[$row->title . " [nid:$row->nid]"] = '<div class="reference-autocomplete">' . $row->title . '</div>';
+  }
 
-    return drupal_json_output($matches);
+  return drupal_json_output($matches);
 }
 
 /**
@@ -208,30 +120,134 @@ function uc_webform_autocomplete_validate($element, &$form_state, $form) {
         }
       }
     }
+  }
+  form_set_value($element, $nid, $form_state);
+}
 
+function uc_webform_application($oid) {
+  $urls = explode('/', $_GET['q']);
+  $webform_order_query = db_query('SELECT * FROM {uc_webform_submission} uc LEFT JOIN {webform_submissions} wc ON uc.sid = wc.sid WHERE order_id = :oid', array(':oid' => $urls[3]));
+  $display = '<ul>';
+  include_once drupal_get_path('module', 'webform') . '/includes/webform.submissions.inc';
+  foreach ($webform_order_query as $record) {
+    // get the result   
+    $display .= '<li>' . l('Webform Results', 'node/' . $record->nid . '/submission/' . $record->sid) . '</li>'; // drupal_render(webform_submission_page($webform, $record->sid, 'html')) . '<hr/>';
   }
+  $display .= '</ul>';
+  return $display;
+}
 
-  form_set_value($element, $nid, $form_state);
+/**
+ * Implements hook_node_load
+ */
+function uc_webform_node_load($nodes, $types) {
+  $result = db_query('SELECT * FROM {uc_webform} WHERE nid IN(:nids)',
+    array(':nids' => array_keys($nodes)));
+  foreach ($result as $record) {
+    if (uc_product_is_product($nodes[$record->nid])) {
+        $nodes[$record->nid]->webform_nid        = $record->webform_nid;
+        $nodes[$record->nid]->uc_webform_submit = $record->submit;
+    }
+  }
+}
+
+/**
+ * Implements hook_node_delete
+ * Is there a confirmation phase as there was in D6 with uc_webform_submission_delete_products_form(), 
+ * where are cart items removed as in D6's uc_webform_submission_delete_products_form_submit()?
+ */
+function uc_webform_node_delete($node) {
+  if (!isset($node->webform_nid) || !isset($node->uc_webform_submit)) return;
+
+  db_delete('uc_webform')
+    ->condition('nid', $node->nid)
+    ->execute();
+}
+
+/** 
+ * Implements hook_node_insert
+ */
+function uc_webform_node_insert($node) {
+  if (uc_product_is_product($node)) {
+    db_insert('uc_webform')
+       ->fields(
+         array(
+           'nid' => $node->nid, 
+           'webform_nid' => $node->webform_nid,
+           'submit' => $node->uc_webform_submit
+      )
+    )
+        ->execute();
+  }
+}
+
+/**
+ * Implements hook_node_update
+ */
+function uc_webform_node_update($node) {
+  // This doesn't look right!
+  uc_webform_node_delete($node);
+  uc_webform_node_insert($node);
+}
+
+/****************************************
+ * Form API 
+ */
+
+/**
+ * Implements hook_form_FORM_ID_alter
+ */
+function uc_webform_form_node_form_alter(&$form, &$form_state) {
+  if ($form['#node']->type == 'webform') {
+      $form['base']['uc_webform_submit'] = array(
+          '#type'             => 'checkbox',
+          '#title'            => t('Add this webform to cart on submission?'),
+          '#default_value'    => isset($form['#node']->uc_webform_submit) ? $form['#node']->uc_webform_submit : FALSE,
+      );
+      $form['#submit'][] = 'uc_webform_form_node_submit';
+  } 
+  elseif ( uc_product_is_product($form['#node']) ) {
+      $form['base']['uc_webform'] = array(
+        '#type' => 'feildset',
+        '#title' => t('Webform Settings')
+      );
+      $form['base']['uc_webform']['webform_nid'] = array(
+          '#type'                 => 'textfield',
+          '#title'                => t('Application Form'),
+          '#autocomplete_path'    => 'uc_webform/autocomplete',
+          '#default_value'        => isset($form['#node']->webform_nid) ? $form['#node']->webform_nid : NULL,
+          '#value_callback'       => 'uc_webform_autocomplete_value',
+          '#element_validate'     => array('uc_webform_autocomplete_validate')
+      );
+      $form['base']['uc_webform']['uc_webform_submit'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Redirect user to cart after form submission.'),
+        '#default_value' => isset($form['#node']->uc_webform_submit) ? $form['#node']->uc_webform_submit : null
+      );
+  }
+}
+
+
+/**
+ * Adjustment for $form['#submit'][]
+ */
+function uc_webform_form_node_submit(&$form, &$form_state) {
 }
 
 function uc_webform_form_uc_product_add_to_cart_form_alter(&$form, &$form_state) {
-  
-  if(isset($form['node']['#value']->webform_nid)){
+  if (isset($form['node']['#value']->webform_nid)) {
     // replace standard add to cart with the webform corresponding to this product
-  
   }
-  
 }
 
 function uc_webform_form_alter(&$form, &$form_state, $form_id) {
-    
-    if($form_id == 'webform_component_form' || $form_id == 'webform_component_edit_form'){
+  if ($form_id == 'webform_component_form' || $form_id == 'webform_component_edit_form') {
 
       // allow select components to change attributes/options selected for a product, ie via sku
-      if($form['type']['#value'] == 'select'){
+      if ($form['type']['#value'] == 'select') {
         $form['extra']['uc_webform_options'] = array(
-          '#title' => t('Product SKU '),
-          '#description' => t('You can choose to set what options will be selected by safe_key|option '),
+          '#title' => 'Product SKU ',
+          '#description' => 'You can choose to set what options will be selected by safe_key|option ',
           '#type' => 'textarea',
           '#default_value' => variable_get('uc_webform_sku_' . $form['nid']['#value'] . '_' . $form['cid']['#value'], '')
         );
@@ -245,58 +261,71 @@ function uc_webform_form_alter(&$form, &$form_state, $form_id) {
     }
 }
 
-function uc_webform_sku_submit(&$form, &$form_state){
+
+/**
+ * Adjustment for $form['#submit'][]
+ */
+function uc_webform_sku_submit(&$form, &$form_state) {
   variable_set('uc_webform_sku_' . $form_state['values']['nid'] . '_' . $form_state['values']['cid'], $form_state['values']['extra']['uc_webform_options']);
   
 }
 
+
+/**
+ * Adjustment for $form['#submit'][]
+ */
 function uc_webform_webform_client_form_submit(&$form, &$form_state) {
-    if (has_completed_webform($form['#node']->nid) == TRUE) {
-
-         $uc_webform_query = db_query('SELECT * FROM {uc_webform} WHERE webform_nid = :nid', array(':nid' => $form['#node']->nid));
-         $uc_webform = null;
-         foreach($uc_webform_query as $record){
-           $uc_webform = $record;
-         }
-        // we need to get the aid and oid to add this to the cart
-        $attributes = array();
-        foreach($form_state['values']['submitted'] as $id => $value){
-         
-         $option_ids = variable_get( 'uc_webform_sku_' . $form['#node']->nid . '_' .$id, NULL );
-         if(isset($option_ids)){
-           // explode the options so that we can set them as part of the add to cart call
-           $option_ids = explode("\n", $option_ids);
-           $available_options = array();
-           foreach($option_ids as $option){
-             $opt = explode("|", $option);
-             $available_options[$opt[0]] = $opt[1]; 
-           }
-           $option_ids = $available_options;
-           
-           $option_name = $option_ids[$value]; // This is the selected option submitted in the webform
-           $attribute_query = db_query('SELECT aid, oid, name FROM {uc_attribute_options} WHERE name = :name', array( ':name' => $option_name ) );
-           foreach($attribute_query as $record){
-             $attributes[$record->aid] = $record->oid;
-           }           
-           
-         }         
-         
-       }
-       $cid = isset($cid) ? $cid : uc_cart_get_id();
-       $items = uc_cart_get_contents();     
-       variable_set('uc_webform_cart_item_' . $items[ count($items) - 1 ]->cart_item_id . '_' . $cid, $form_state['values']['details']['sid'] );
-       
-       uc_cart_add_item( $uc_webform->nid, 1, array( 
-            'attributes' => $attributes,
-            'sid' => $form_state['values']['details']['sid'] /* forward our sid */
-            ) );
-        $product = node_load($uc_webform->nid);
-        if($product->uc_webform__submit == 1){
-        // drupal_goto('cart');   
+  if (has_completed_webform($form['#node']->nid) == TRUE) {
+
+    $uc_webform_query = db_query('SELECT * FROM {uc_webform} WHERE webform_nid = :nid', array(':nid' => $form['#node']->nid));
+    $uc_webform = NULL;
+    foreach ($uc_webform_query as $record) {
+      $uc_webform = $record;
+    }
+
+    // we need to get the aid and oid to add this to the cart
+    $attributes = array();
+    foreach ($form_state['values']['submitted'] as $id => $value) {
+
+      $option_ids = variable_get( 'uc_webform_sku_' . $form['#node']->nid . '_' . $id, NULL);
+      if (isset($option_ids)) {
+        // explode the options so that we can set them as part of the add to cart call
+        $option_ids = explode("\n", $option_ids);
+        $available_options = array();
+        foreach ($option_ids as $option) {
+          $opt = explode("|", $option);
+          $available_options[$opt[0]] = $opt[1]; 
         }
+        $option_ids = $available_options;
+
+        $option_name = $option_ids[$value]; // This is the selected option submitted in the webform
+        $attribute_query = db_query('SELECT aid, oid, name FROM {uc_attribute_options} WHERE name = :name', array( ':name' => $option_name ) );
+        foreach ($attribute_query as $record) {
+          $attributes[$record->aid] = $record->oid;
+        }
+      }
     }
+    $cid = isset($cid) ? $cid : uc_cart_get_id();
+    $items = uc_cart_get_contents($cid);
+
+    $count_items = count($items) - 1;
+    if ($count_items >= 0) {
+      variable_set('uc_webform_cart_item_' . $items[$count_items]->cart_item_id . '_' . $cid, $form_state['values']['details']['sid'] );
+    }
+
+    $data = array( 
+      'attributes' => $attributes,
+      'sid' => $form_state['values']['details']['sid'] /* forward our sid */
+    );
+    uc_cart_add_item($uc_webform->nid, 1, $data);
+    $product = node_load($uc_webform->nid);
+    if ($product->uc_webform__submit == 1) {
+      // drupal_goto('cart');
+    }
+  }
 }
 
+
 /****************************************
  * Ubercart Hooks
  */
@@ -332,7 +361,8 @@ function uc_webform_uc_add_to_cart($nid, &$qty, &$data) {
 }
 
 function _uc_webform_add_to_cart($node) {
-    // if this product has a webform add that to the cart instead and attach this node as data
+    // if this product has a webform add that to the cart instead and attach this 
+    // node as data
     $items = uc_cart_get_contents();
     foreach ($items as $item) {
         if ($item->nid == $node->webform_nid) {
@@ -351,55 +381,57 @@ function _uc_webform_add_to_cart($node) {
 }
 
 /**
- * Implements hook_uc_order()
+ * Implements hook_uc_order().
  */
 function uc_webform_uc_order($op, &$arg1, $arg2) {
-    switch ($op) {
-        case 'save':
-           
-            foreach ($arg1->products as $product) {
-                if (isset($product->data['sid'])) {
-                    _uc_webform_save_submission($product->data['sid'], $arg1);
-                }
-            }
-           // _uc_webform_order_load($arg1);
-            break;
-        case 'new':
-        case 'load':
-           // _uc_webform_order_load($arg1);
-            break;
-    }
+  switch ($op) {
+    // case 'submit':
+    // case 'update':
+
+    case 'save':
+      foreach ($arg1->products as $product) {
+        if (isset($product->data['sid'])) {
+          _uc_webform_save_submission($product->data['sid'], $arg1);
+        }
+      }
+      // _uc_webform_order_load($arg1);
+      break;
+
+    case 'new':
+      case 'load':
+        // _uc_webform_order_load($arg1);
+        break;
+  }
 }
 
 /**
- * Implements hook_uc_cart_item()
+ * Implements hook_uc_cart_item() - NOTE THIS IS REMOVED in Ubercart beta 4.
+ * See http://drupal.org/node/1424852#comment-5611230
  */
 function uc_webform_uc_cart_item($op, &$item) {
-   
-    
-    switch ($op) {
-        case 'load':
-          $item->data['sid'] = variable_get('uc_webform_cart_item_' . $item->cart_item_id . '_' . $item->cart_id, null );
-        break;
-        case 'remove':
-            if (isset($item->data['sid'])) {
-                // Delete any anonymous session information.
-                if (isset($_SESSION['webform_submission'][$item->data['sid']])) {
-                    unset($_SESSION['webform_submission'][$item->data['sid']]);
-                }
-
-                db_delete('webform_submitted_data')
-                    ->condition('sid', $item->data['sid'])
-                    ->execute();
-                db_delete('webform_submissions')
-                    ->condition('sid', $item->data['sid'])
-                    ->execute();
-                db_delete('uc_webform_submission')
-                    ->condition('sid', $item->data['sid'])
-                    ->execute();
-            }
-            break;
-    }
+  switch ($op) {
+    case 'load':
+      $item->data['sid'] = variable_get('uc_webform_cart_item_' . $item->cart_item_id . '_' . $item->cart_id, NULL);
+      break;
+    case 'remove':
+      if (isset($item->data['sid'])) {
+        // Delete any anonymous session information.
+        if (isset($_SESSION['webform_submission'][$item->data['sid']])) {
+            unset($_SESSION['webform_submission'][$item->data['sid']]);
+        }
+
+        db_delete('webform_submitted_data')
+          ->condition('sid', $item->data['sid'])
+          ->execute();
+        db_delete('webform_submissions')
+          ->condition('sid', $item->data['sid'])
+          ->execute();
+        db_delete('uc_webform_submission')
+          ->condition('sid', $item->data['sid'])
+          ->execute();
+      }
+    break;
+  }
 }
 
 /****************************************
@@ -407,7 +439,7 @@ function uc_webform_uc_cart_item($op, &$item) {
  */
 
 /**
- * Implements hook_webform_submission_insert()
+ * Respond to a Webform submission being inserted - hook_webform_submission_insert().
  */
 function uc_webform_webform_submission_insert($node, $submission) {
     $found = FALSE;
@@ -420,11 +452,12 @@ function uc_webform_webform_submission_insert($node, $submission) {
         } 
     } 
 
-    // we didnt find the node in the cart, so lets add it
+    // We didnt find the node in the cart, so lets add it.
     if ($found !== TRUE && isset($node->uc_webform_submit) && $node->uc_webform_submit) {
         $data['sid'] = $submission->sid;
         uc_cart_add_item($node->nid, 1, $data);
     }
+
 }
 
 /**
@@ -437,7 +470,7 @@ function uc_webform_webform_submission_delete($node, $submission) {
 }
 
 /**
- * Implements hook_webform_submission_load(&$submissions)
+ * Implements hook_webform_submission_load(&$submissions).
  */
 function uc_webform_webform_submission_load(&$submissions) {
     foreach ($submissions as $delta => $submission) {
@@ -447,7 +480,7 @@ function uc_webform_webform_submission_load(&$submissions) {
             ->execute()
             ->fetchAssoc();
         if ($query) {
-            $submissions[$delta]        = (object) array_merge((array)$submission, $query);
+            $submissions[$delta] = (object) array_merge((array)$submission, $query);
         }
     }
 }
@@ -456,10 +489,8 @@ function uc_webform_webform_submission_load(&$submissions) {
  */
 function uc_webform_webform_submission_render_alter(&$renderable) {
     if (!isset($renderable['#submission']->order_id)) return;
-
-   
-
 }
+
 /****************************************
  * Helper functions
  */
@@ -494,6 +525,5 @@ function _uc_webform_save_submission($sid, $order) {
         ->execute();
     db_insert('uc_webform_submission')
         ->fields($fields)
-        ->execute();    
+        ->execute();
 }
-
