writer abstraction added
added writer abstraction, fixed input merge conflict