modified main() to accept command line arguments