box.removeEventListener('pointerdown', handle_pointerdown);
        box.removeEventListener('pointerup', handle_pointerup);
        box.removeEventListener('contextmenu', handle_contextmenu);
        box.removeEventListener('lostpointercapture',
          handle_lostpointercapture);
      }

      function addEventListeners(){
        box.addEventListener('pointerdown', handle_pointerdown);
        box.addEventListener('pointerup', handle_pointerup);
        box.addEventListener('contextmenu', handle_contex