util_calc_boundaries function

util_calc_boundaries