started moving iteration output to filewriter