moved the code to use writers...