improved getSizeAndStartOfCubes method, removed cubeMappingInv array