Partial implementation of minccalc.