Added support for file names to be passed by command line arguments

With basic error checking