Added output to File functionality