refactored cube to C++ class
converted everything to c++