Added ability to redirect output to a file. May not work with arguments.