         const frames = document.getElementById('frames');
            
            const existingFrames = Array.from(frames.children);
            const insertPosition = existingFrames.findIndex(frame => {
                return parseInt(frame.dataset.timestamp) < parseInt(container.dataset.timestamp);
            });
            
            if (insertPosition === -1) {
                frames.appendChild(container);
            } else {
                frames.insertBefore(container, existingFrames[insertP