added spreadsheet generation code