Added template unrolling, statistics with histograms