 1); // 1 real second = 10 Earth days

            // Send data to worker
            worker.postMessage({
                bodies: planets,
                elapsedTime: elapsedTime * 10, // timeScale: 10 earth days per second
                timeScale: 10
            });

            ctx.clearRect(0, 0, canvas.width, canvas.height);
            // Draw orbits from off-screen canvas
            ctx.drawImage(offscreenCanvas, 0, 0);

            // Draw sun and planets
            ctx.save();
            ctx.