added delete of out file prior to write