Added checking for commandline inputs of input file and output file as arg1 and arg2.
Also added output to a txt file instead of stdout.