Index: fact/tools/rootmacros/PulseTemplates/Sample.C
===================================================================
--- fact/tools/rootmacros/PulseTemplates/Sample.C	(revision 14951)
+++ fact/tools/rootmacros/PulseTemplates/Sample.C	(revision 14952)
@@ -198,7 +198,8 @@
 Sample::BootstrapTH1(TH1* inputHisto, TH1*  outHisto)
 {
+    //reset outHisto in case it is reused
     outHisto->Reset();
 
-    //compute the median for 1-d histogram h1
+    //compute number of bins for 1-d histogram h1
     int nbins = inputHisto->GetXaxis()->GetNbins();
 
@@ -206,16 +207,21 @@
     //we need to get the binning
 
-    //entries of TH1
+    //vector to contain entries of TH1
     vector<double>    entries;
 
     //quantity of entries in bin
-    int quantity    = 0;
-    double value       = 0;
+    int     quantity    = 0;        //number of entries in a bin
+    double  value       = 0;        //value of a bin
+
+    //Loop over bins to fill entries vektor
     for (int i=0;i<nbins;i++)
     {
         value       = inputHisto->GetBinLowEdge(i);
         quantity    = inputHisto->GetBinContent(i);
+        //Loop over bin quantities
         for (int j = 0; j < quantity; j++)
         {
+            // fill entries vektor with value of a bin
+            // as many times as the bin has entries
             entries.push_back(value);
         }
@@ -230,5 +236,6 @@
     vector<int> entryID (sampleSize,0);
 
-    //calculate a list with random EntryIDs and fill it into entryID
+    //calculate a list with random int numbers between 0 ad sampleSize
+    // and fill it into entryID vector
     BootstrapSample(&entryID, 0, sampleSize, sampleSize );
 
@@ -237,4 +244,5 @@
     for ( unsigned int i = 0 ; i < entryID.size(); i++ )
     {
+        //fill values pulled from entries vektor into outHisto
         outHisto->Fill(
                     entries.at( entryID.at(i) )
@@ -243,4 +251,5 @@
     }
 
+    //return the nummber of filled entries
     return counter + 1;
 }
