added much improved spreadsheet writing