UNTESTED. Finished moving all of the file initialization code to its own function. Created code to generate a new output file every time the day changes (i.e. at midnight).