Measuring volume with unit cubes