added writer and writer_test