modified calc_well