rewriting unit size code