moved test mode to argument