Fixed the way of generating the cubic and 2d