upgrades to test function and fix for error getting command line argument