Implemented the Cube Operation and fixed some bugs