progress on pdf and changes way stats are generated