Corrected te writer.writerow() to include correct field names