Fixed write to file. I thought I was printing each element of a list.