writeSheets() now creates sheets properly, changed some comments