Added code to generate frequency and statistical data to PDF file.