Swtich density calculations to use units.