Added Histogram and Statistics Extraction as well as testing subroutines