Major code changes. Optimized.

Fix the bug that affects the scaling issue of the cubes!!!