-- returns cube #1 if we would have returned cube #0 and cube #1
-- exists.
| coord == offset && (xsize > 0 && ysize > 0 && zsize > 0) = 1
+ | coord < offset = 0
| otherwise = (ceiling ( (coord + offset) / cube_width )) - 1
where
(xsize, ysize, zsize) = dims (function_values g)