Displaying terms by first letter

Try this code.

<?php
$taxonomy = 'authors';//  e.g. post_tag, category
$param_type="authors"; //  e.g. tag__in, category__in
$term_args=array(
            'orderby' => 'name',
            'order' => 'ASC'
);
$terms = get_terms($taxonomy,$term_args);
if ($terms) {
    $first_letter = null;
    foreach( $terms as $term ) {

        $flag = 0;

        if( $first_letter != substr( $term->name, 0, 1 ) ) {
          $first_letter = substr( $term->name, 0, 1 );
          $flag = 1;
        }

        if( $flag ) {
          echo '<strong>'.$first_letter.'</strong>'; // Output the first letter
        }

        $args=array(
          "$param_type" => $term->slug,
          'post_type' => 'reviews',
          'post_status' => 'publish',
          'posts_per_page' => -1,
          'caller_get_posts'=> 1,
          'meta_key' => 'booktitle', 
          'orderby' => 'meta_value',
          'order' => 'ASC'
          );

        $my_query = null;
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
            echo '<h2>'.$term->name.'</h2>';
            while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <a href="https://wordpress.stackexchange.com/questions/36807/<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo c2c_get_custom('booktitle'); ?></a> by <?php echo c2c_get_custom('author'); ?><br /><?php
            endwhile;
        }
    }
}
wp_reset_query();  // Restore global post data stomped by the_post().
?>