small patch for checking command-line argument
formatted and commented the code