finding volume with unit cubes