Program now takes the input file as a command line argument. Also added argument validity checks in main().