added main function and a command line argument parser