changed way file was written