Added actual write to file using writelines(list)

Verified output file by inspection