added input file mode