 
           # copy the ndstore response into the new array, respecting the bounds of the dataset
           index = 0
-          for z in [bucketBounds[2]...bucketBounds[5] or bucket.cubeSize]
-            for y in [bucketBounds[1]...bucketBounds[4] or bucket.cubeSize]
-              for x in [bucketBounds[0]...bucketBounds[3] or bucket.cubeSize]
+          for z in [bucketBounds[2]...bucketBounds[5]]
+            for y in [bucketBounds[1]...bucketBounds[4]]
+              for x in [bucketBounds[0]...bucketBounds[3]]
                 buffer[z * bucketSize * bucketSize + y * bucketSize + x] = dataView.getUint8(index++)
           resolve(buffer)
-        (error) =>
+        (error) ->
           reject(error)
       )
     )


  getMaxCoordinatesAsBucket : (bounds, bucket) ->

    return _.map(bounds, (e) => e % (1 << ( @cube.BUCKET_SIZE_P + bucket.zoomStep )))


  setFourBit : (@fourBit) ->

    newColors


  clampBucketToMaxCoordinates : ( {position, zoomStep} ) ->

    min = @layer.lowerBoundary
    max = @layer.upperBoundary

    cubeSize = 1 << @cube.BUCKET_SIZE_P + zoomStep

    [ x, y, z ] = position
    return [
      Math.max(min[0], x)
      Math.max(min[1], y)
      Math.max(min[2], z)
      Math.min(max[0], x + cubeSize)
      Math.min(max[1], y + cubeSize)
      Math.min(max[2], z + cubeSize)
