added stuff to write output to workbook