diff --git a/public/Cube.html b/public/Cube.html
index adc70a0b9d3b86f5f395d80a65e318df804ca324..568820851e2858031634610a0d75198ffedc2cc7 100644
--- a/public/Cube.html
+++ b/public/Cube.html
@@ -24,7 +24,8 @@ async function activateXR() {
   const scene = new THREE.Scene();
 
 // The cube will have a different color on each side.
-const materials = [
+const cubeGeometry = new THREE.BoxBufferGeometry(0.5, 0.5, 0.5);
+const cubeMaterials = [
   new THREE.MeshBasicMaterial({color: 0x003366}),
   new THREE.MeshBasicMaterial({color: 0x66ccff}),
   new THREE.MeshBasicMaterial({color: 0xff6666}),
@@ -34,7 +35,7 @@ const materials = [
 ];
 
 // Create the cube and add it to the demo scene.
-const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.5, 0.5, 0.5), materials);
+const cube = new THREE.Mesh(cubeGeometry, cubeMaterials);
 cube.position.set(0, 0, -1);
 scene.add(cube);