added the main() function and command line parameter processing.