diff --git a/autocomplete_widgets.admin.inc b/autocomplete_widgets.admin.inc
index c8cd9d4..a5488d9 100755
--- a/autocomplete_widgets.admin.inc
+++ b/autocomplete_widgets.admin.inc
@@ -90,7 +90,7 @@ function _autocomplete_widgets_field_widget_settings_form($field, $instance) {
     $settings['suggested_values'] = !isset($settings['suggested_values']) ? '' : $settings['suggested_values'];
     $form['suggested_values'] = array(
       '#type' => 'textarea',
-      '#title' => t('Suggeset values list'),
+      '#title' => t('Suggested values list'),
       '#default_value' => $settings['suggested_values'],
       '#rows' => 10,
       '#description' => t('Autocomplete requests will only respond with suggestions from this list. If a user enters a value not on this list, it will <em>not</em> be added to the autocomplete options in the future. Enter one suggestion per line.'),
@@ -113,5 +113,18 @@ function _autocomplete_widgets_field_widget_settings_form($field, $instance) {
     );
   }
 
+  $settings['order'] = !isset($settings['order']) ? 'ASC' : $settings['order'];
+  $form['order'] = array(
+    '#type' => 'select',
+    '#title' => t('Order'),
+    '#options' => array(
+      'ASC' => t('A to Z'),
+      'DESC' => t('Z to A'),
+    ),
+    '#empty_option' => t('Don\'t Sort'),
+    '#default_value' => $settings['order'],
+    '#description' => t('Choose in which order should autocomplete suggestions be displayed.'),
+  );
+
   return $form;
 }
diff --git a/autocomplete_widgets.common.inc b/autocomplete_widgets.common.inc
index a8e0cc9..65b6384 100755
--- a/autocomplete_widgets.common.inc
+++ b/autocomplete_widgets.common.inc
@@ -8,12 +8,12 @@
 /**
  * Fetch an array of options for the given widget.
  *
- * @param $field
- *   The field description.
+ * @param $instance
+ *   A structured array describing the field instance.
  * @param $string
  *   Optional string to filter values on (used by autocomplete).
  * @param $match
- *   Operator to match filtered name against, can be any of:
+ *   Operator to match filtered name against. Can be any of:
  *   'contains', 'equals', 'starts_with'
  * @param $keys
  *   Optional keys to lookup (the $string and $match arguments will be
@@ -28,30 +28,43 @@
  *     ...
  *   )
  */
-function _autocomplete_widgets_get_options($field, $string = '', $match = 'contains', $keys = NULL, $limit = NULL) {
+function _autocomplete_widgets_get_options($instance, $string = '', $match = 'contains', $keys = NULL, $limit = NULL) {
   static $results = array();
 
   // Create unique id for static cache.
   if (!isset($keys) || !is_array($keys)) {
     $keys = array();
   }
-  $cid = $field['field_name'] .':'. $match .':'. ($string !== '' ? $string : implode('-', $keys)) .':'. $limit;
+  $cid = $instance['field_name'] .':'. $match .':'. ($string !== '' ? $string : implode('-', $keys)) . ':' . $limit;
 
   if (!isset($results[$cid])) {
-    if ($field['widget']['type'] == 'autocomplete_widgets_allowvals') {
-      $results[$cid] = _autocomplete_widgets_get_options_allowvals($field, $string, $match, $keys, $limit);
-    }
-    else if ($field['widget']['type'] == 'autocomplete_widgets_flddata') {
-      $results[$cid] = _autocomplete_widgets_get_options_flddata($field, $string, $match, $keys, $limit);
-    }
-    else if ($field['widget']['type'] == 'autocomplete_widgets_suggested') {
-      $results[$cid] = _autocomplete_widgets_get_options_suggested($field, $string, $match, $keys, $limit);
-    }
-    else if ($field['widget']['type'] == 'autocomplete_widgets_node_reference') {
-      $results[$cid] = _autocomplete_widgets_get_options_node_reference($field, $string, $match, $keys, $limit);
+    switch ($instance['widget']['type']) {
+      case 'autocomplete_widgets_allowvals':
+        $results[$cid] = _autocomplete_widgets_get_options_allowvals($instance, $string, $match, $keys, $limit);
+        break;
+      case 'autocomplete_widgets_flddata':
+        $results[$cid] = _autocomplete_widgets_get_options_flddata($instance, $string, $match, $keys, $limit, $order);
+        break;
+      case 'autocomplete_widgets_suggested':
+        $results[$cid] = _autocomplete_widgets_get_options_suggested($instance, $string, $match, $keys, $limit, $order);
+        break;
+      case 'autocomplete_widgets_node_reference':
+        $results[$cid] = _autocomplete_widgets_get_options_node_reference($instance, $string, $match, $keys, $limit, $order);
+        break;
+      default:
+        $results[$cid] = array();
     }
-    else {
-      $results[$cid] = array();
+
+    // Reorder the options.
+    if (isset($instance['widget']['settings']['order'])) {
+      switch ($instance['widget']['settings']['order']) {
+        case 'ASC':
+          sort($results[$cid]);
+          break;
+        case 'DESC':
+          rsort($results[$cid]);
+          break;
+      }
     }
   }
 
@@ -64,14 +77,13 @@ function _autocomplete_widgets_get_options($field, $string = '', $match = 'conta
  * Options are retrieved from the allowed values defined for the field.
  */
 function _autocomplete_widgets_get_options_allowvals($field, $string = '', $match = 'contains', $keys = NULL, $limit = NULL) {
-
   $field_name = $field['field_name'];
   $allowed_values = list_allowed_values(field_info_field($field_name));
   $limit = (!isset($limit) || !is_numeric($limit)) ? count($allowed_values) : $limit;
   $case_sensitive = $field['widget']['settings']['autocomplete_case'];
   $filter_xss = !empty($field['widget']['settings']['autocomplete_xss']);
   $options = array();
-  $count = 0;
+  $count = 0; //@todo: cant the count var be replaced with a call to count()?
 
   foreach ($allowed_values as $key => $value) {
     if ($filter_xss) {
@@ -131,6 +143,7 @@ function _autocomplete_widgets_get_options_flddata($field, $string = '', $match
 
   if ($string !== '') {
     $case_sensitive = empty($field['widget']['autocomplete_case']);
+    //@todo: there is no need to check case sensitivty of $column.
     $col = $case_sensitive ? $column : strtolower($column);
     $val = $case_sensitive ? $string : strtolower($string);
 
@@ -237,6 +250,7 @@ function _autocomplete_widgets_get_options_node_reference($field, $string = '',
         $node_title_query->condition('n.title', '%' . $string . '%', 'LIKE');
         break;
     }
+    //@todo: can these fetch all's be replaced with fetchAssoc?
     $rows = $node_title_query->execute()->fetchAll(PDO::FETCH_ASSOC);
     foreach($rows as $row) {
       $options[$row['title']] = $row['title'];
@@ -246,7 +260,7 @@ function _autocomplete_widgets_get_options_node_reference($field, $string = '',
       $options[$row[$column]] = $row[$column];
     }
   }
-  sort($options);
+
   return $options;
 }
 
diff --git a/autocomplete_widgets.module b/autocomplete_widgets.module
index c2d9e42..264da6b 100755
--- a/autocomplete_widgets.module
+++ b/autocomplete_widgets.module
@@ -248,10 +248,11 @@ function autocomplete_widgets_field_formatter_view($entity_type, $entity, $field
  */
 function autocomplete_widgets_json($entity_type, $bundle_name, $field_name, $string = '') {
   module_load_include('inc', 'autocomplete_widgets', 'autocomplete_widgets.common');
-  $field = field_info_instance($entity_type, $field_name, $bundle_name);
+  $instance = field_info_instance($entity_type, $field_name, $bundle_name);
   $match = isset($field['widget']['settings']['autocomplete_match']) ? $field['widget']['settings']['autocomplete_match'] : 'contains';
   $matches = array();
-  $options = _autocomplete_widgets_get_options($field, $string, $match, NULL, 10);
+
+  $options = _autocomplete_widgets_get_options($instance, $string, $match, NULL, 10);
   foreach ($options as $key => $label) {
     // Add a class wrapper for a few required CSS overrides.
     $matches[$label] = '<div class="reference-autocomplete">'. check_plain($label) .'</div>';
