Refactored Cube.cs