Implemented Cube, in a sufficiently general way that it also handles