added spreadsheet writing