Corrected file orientation

Fixed orientation of data write