reduce calc_ambiguity's RAM hogging
reduce calc_ambiguity's RAM hogging