implement writer