hook_theme, custom data, passing to custom TPL file I am having trouble passing custom data through theme() to a custom callback and passing the data through to a tpl file. Here is my code:

hook_theme:

function satb_schedule_theme() {
  return array(
    'satb_schedule_brackets' =&gt; array(
      'render element' =&gt; 'bracket',
      'variables' =&gt; array('bracket' =&gt; array()),
      'template' =&gt; 'satb_schedule_brackets',
      'path' =&gt; drupal_get_path('module', 'satb_schedule') . '/templates',
    )
  );
}


hook_menu item:

$items['tournaments/%/%/schedule/winner-bracket'] = array(
    'title' =&gt; 'Winner Bracket',
    'description' =&gt; 'View the winner brackets for this tournament.',
    'page callback' =&gt; 'satb_schedule_generate_bracket',
    'page arguments' =&gt; array(1, 2, '0'),
    'weight' =&gt; -16,
    'type' =&gt; MENU_LOCAL_TASK,
    'access arguments' =&gt; array('view tournament brackets'),
  );


hook_menu item callback (satb_schedule_generate_bracket):

function satb_schedule_generate_bracket($nid, $product_id, $bracket_type) {
  $schedule = new SATBScheduleDisplay(array('nid' =&gt; $nid, 'product_id' =&gt; $product_id));
  return $schedule-&gt;getTournamentBracket($bracket_type);
}


This function generates an array of data. Inside of the method, data is gathered and returned through theme(), like so:

$output = theme('satb_schedule_brackets', array('bracket' =&gt; $brackets));
return $output;


In the template.php, I have this to modify and add variables for the template:

function satb_preprocess_satb_schedule_brackets($variables) {
  $brackets = $variables['bracket'];

  foreach($brackets as $key =&gt; $round) {
    switch ($key) {
      case 3:
        $classes = array('round', 'quarterfinal');
        $round_title = t('Quarter Finals');
        break;
      case 2:
        $classes = array('round', 'semifinal');
        $round_title = t('Semi-Finals');
        break;
      case 1:
        $classes = array('round', 'final');
        $round_title = t('Final');
        break;
      default:
        $classes = array('round');
        $round_title = t('Round @round_number', array('@round_number' =&gt; $key));
        break;
    }

    $variables['bracket'][$key]['data'] = array('classes' =&gt; implode(' ', $classes), 'round-title' =&gt; $round_title);
  }

  $vars['bracket'] = $variables['bracket'];
  $vars['tournament_title'] = 'Just a test';
  return $vars;
}


My custom tpl is loaded (I can see the static HTML in there as a test and print static vars) however, my modifications don't seem to get passed to the template.

For example, if I do print $tournament_name;, its null. If I do print $bracket['tournament_title']- it appears, but I don't want to access variables like that because that's messy, and, it should respect the vars I am adding to the vars array.

What am I missing here? The classes and titles I am adding in the preprocess are also missing in the $bracket element in the TPL. The $vars has them, but the TPL does not.
Doh. $variables is passed by reference. I always forget this in template.php:

function satb_preprocess_satb_schedule_brackets(&amp;$variables) {