How is density calculated?