function get_shipping_options($shipping_configuration)
 {
     if ($this->cache_result) {
         if (($options = $this->_get_cached_options($shipping_configuration)) !== false) {
             return $options;
         }
     }
     if (!($options = $this->_do_get_shipping_options($shipping_configuration))) {
         return array();
     }
     $options = complex_array::sort_array($options, array('price' => 'ASC'));
     if ($this->cache_result) {
         $this->_save_cached_options($shipping_configuration, $options);
     }
     return $options;
 }
  function _do_sort(& $tree_array, & $sorted_tree_array, $sort_params, $parent_id, $id_hash, $parent_hash)
  {
 		$children = array();
 		
  	foreach($tree_array as $index => $item)
  	{
  		if($item[$parent_hash] == $parent_id)
  		{
  			$children[] = $item;
  			unset($tree_array[$index]);
  		}
  	}

  	if(!($count = sizeof($children)))
  		return;
		
		$children = complex_array :: sort_array($children, $sort_params);
		
		if(!$sorted_tree_array)
		{
			$sorted_tree_array = $children;
		}
		else
		{
			$ids = complex_array :: get_column_values($id_hash, $sorted_tree_array);
			
			$offset = array_search($parent_id, $ids) + 1;
			
			array_splice($sorted_tree_array, $offset, 0, $children);
		}
		
    for($i=0; $i < $count; $i++)
    {
	   	tree_sorter :: _do_sort($tree_array, $sorted_tree_array, $sort_params, $children[$i][$id_hash], $id_hash, $parent_hash);
    }
  }  
  function _check_proper_nesting($nodes, $line='')
  {
    $this->assertEqual(complex_array :: sort_array($nodes, array('path' => 'ASC')),
                       $nodes);

    $path = complex_array :: get_min_column_value('path', $nodes, $index);
    $parent_paths[] = $this->_get_parent_path($path);

    $counter = 0;
    foreach($nodes as $id => $node)
    {
      $parent_path = $this->_get_parent_path($node['path']);

      $this->assertTrue(in_array($parent_path, $parent_paths),
        'path is improperly nested: ' . $node['path'] . ' , expected parent not found: ' . $parent_path . ' at line: ' . $line);

      $parent_paths[] = $node['path'];
    }
  }