Changed main to take command line arguments