convert the functions to class: cube_partition.py/CubePartition