Added a test mode for easy validation and the ability to pass an optional region  variable to override the specified default