added direct test mode with command line arguments