Improved file output