Edited the script to print directly to file device.