cubes method