generate win
write to file