Changed the ordering of reading the arguments from the command line.