anchor.diff:                       value_hash.each do |value_id, formatted_value| %>
                         <%= formatted_value %>
                         <% if @results[:include_references]
  -                        source_number = categorical_trait_values[:sources][value_id] %>
  +                        source_reference_id = categorical_trait_values[:sources][value_id]
  +                        source_ids << source_reference_id unless source_reference_id.in? source_ids
  +                        source_number = source_ids.index(source_reference_id) + 1
  +                      %>
                           [<%= link_to("#{source_number}", "#source_#{source_number}") %>]
                         <% end %>
                         <% end %>
  
positive.code:                      value_hash.each do |value_id, formatted_value| %>
                      <%= formatted_value %>
                      <% if @results[:include_references]
                        source_number = continuous_trait_values[:sources][value_id] %>
                        [<%= link_to("#{source_number}", "#source_#{source_number}") %>]
                      <% end %>
                    <% end %>
  
negative.code:       <div class="row-fluid">
          <table class="table table-condensed table-bordered table-striped table-hover ">
            <tr></tr><th>#</th><th>Source</th></tr>
            <% source_ids.each_with_index do |source_id, index| %>
            <tr id="<%= "source_#{index + 1}" %>">
              <td><%= index + 1 %></td>
              <td><%= @results[:sources].find{|x| x[:id] == source_id}[:name] %></td>
            </tr>
            <% end %>
          </table>
  