Changed the format in which data is written to the text file. Added a check if data has already been written today.