Transforming square to cube