Algo working for empty cubes