     for(let i=0;i<rpcs[0].length;i++) 
        klampt_frontend.rpc(rpcs[0][i]);
    }
    klampt_frontend.render();
    animationTime = 0;
    animate();
  }

  function resetplay() {
    animating = false;
    make_play('play_pause');
    animationTime = 0;
    document.getElementById('slider').value = 0;
    lastAnimateTime = null;
    update_time()
  }

  function toggleplaypause() {
    if(animating) {
      animating = false;
      lastAnimateTime = null;
      make_play('play_pause');
    }
    else 