some modifications to Cubes.cpp