add writer module
add tests