More refinement of digi code.