added code to write pieces of data to excel file