added input file support