changed for loop for writing the ct histograms to the i method that Allen showed me