toCube() method added