added write to file for single line. next add loop to main method.