improved output files greatly