added min_max to get region boundaries for region_check.  region_check now uses min row and max row to determine safe region for detection.