rewriting unit size calculations