Added a new way to write in file.