Corrected write.file to create a wide version