Added file write out