Added a debug mode and some debug output to generatestats to figure out why the graphs are covering the wrong length of time.