change from system output to file write
initialize