Updated file output

creates a file with correct output filename