Brett - modified code to take command line input