Replaced data output in terminal into saving to file..