added writing of sheet3