code now takes arguments from command line