modified to be able to specify input file and Rparam in command line