added write to file feature to weather station program