writes input file